public abstract class RouteNode extends Object implements Comparable<RouteNode>
Node
instance. It is denoted as "rnode".
The routing resource graph is built "lazily", i.e., RouteNode Objects (rnodes) are created when needed.Modifier and Type | Field and Description |
---|---|
static short |
capacity
Each RouteNode Object can be legally used by one net only
|
static RouteNode[] |
EMPTY_ARRAY
Memoized static array for use by Collection.toArray() or similar
|
static int |
initialHistoricalCongestionCost |
static int |
initialPresentCongestionCost |
Modifier and Type | Method and Description |
---|---|
void |
clearPrev()
Clears the parent RouteNode instance.
|
int |
compareTo(RouteNode that) |
int |
countConnectionsOfUser(NetWrapper user)
Counts the connections of a user that are using a rnode.
|
void |
decrementDriver(RouteNode parent)
Decrements the driver count of a RouteNode instance.
|
void |
decrementUser(NetWrapper user)
Decrements the connection count of a user that is represented by a
NetWrapper instance corresponding to a Net instance. |
boolean |
equals(Object obj) |
boolean |
everExpanded()
Checks if a RouteNode instance has ever been expanded, as determined
by whether its children member is null.
|
float |
getBaseCost()
Gets the base cost of a RouteNode Object.
|
short |
getBeginTileXCoordinate() |
short |
getBeginTileYCoordinate() |
RouteNode[] |
getChildren()
Gets the children of a RouteNode Object.
|
float |
getDelay()
Gets the delay of a RouteNode Object.
|
short |
getEndTileXCoordinate()
|
short |
getEndTileYCoordinate()
|
boolean |
getFlag(int index) |
float |
getHistoricalCongestionCost()
Gets the historical congestion cost of a RouteNode Object.
|
short |
getLength()
Gets the wirelength.
|
static short |
getLength(Node node) |
float |
getLowerBoundTotalPathCost()
Gets the lower bound total path cost.
|
Node |
getNode()
Gets the associated Node of a RouteNode Object.
|
int |
getOccupancy()
Gets the number of users.
|
float |
getPresentCongestionCost()
Gets the present congestion cost of a RouteNode Object.
|
RouteNode |
getPrev()
Gets the parent RouteNode instance for routing a connection.
|
abstract int |
getSLRIndex() |
RouteNodeType |
getType()
Gets the type of a RouteNode Object.
|
float |
getUpstreamPathCost()
Gets the upstream path cost.
|
Map<NetWrapper,Integer> |
getUsersConnectionCounts()
Gets a map that records users of a
RouteNode instance based on all routed connections. |
int |
hashCode() |
boolean |
hasMultiDrivers()
Checks if a RouteNode Object are illegally driven by multiple drivers.
|
void |
incrementDriver(RouteNode parent)
Adds a driver to the driver map.
|
void |
incrementUser(NetWrapper user)
Adds an user
NetWrapper instance to the user map, of which a key is a NetWrapper instance and
the value is the number of connections that are using a rnode. |
abstract boolean |
isExcluded(Node parent,
Node child)
Checks if a routing arc has been excluded thus cannot be used.
|
static boolean |
isExitNode(Node node)
Checks if a node is an exit node of a NodeGroup
|
boolean |
isInConnectionBoundingBox(Connection connection)
Checks if coordinates of a RouteNode Object is within the connection's bounding box.
|
boolean |
isOverUsed()
Checks if a RouteNode Object has been used by more than one users.
|
abstract boolean |
isPreserved(Node node)
Checks if a node has been preserved and thus cannot be used.
|
boolean |
isTarget()
Checks if a RouteNode Object is the current routing target.
|
boolean |
isUsed()
Checks if a RouteNode Object has been used.
|
boolean |
isVisited(int id)
Checks if a RouteNode instance has been visited by a specific integer identifier.
|
abstract boolean |
mustInclude(Node parent,
Node child)
Checks if a routing arc must be included.
|
void |
resetChildren()
Clears the children of this node so that it can be regenerated.
|
void |
setFlag(int index,
boolean value) |
void |
setHistoricalCongestionCost(float historicalCongestionCost)
Gets the historical congestion cost of a RouteNode Object.
|
void |
setLowerBoundTotalPathCost(float totalPathCost)
Sets the lower bound total path cost.
|
void |
setPresentCongestionCost(float presentCongestionCost)
Sets the present congestion cost of a RouteNode Object.
|
void |
setPrev(RouteNode prev)
Sets the parent RouteNode instance for routing a connection.
|
void |
setTarget(boolean isTarget)
Sets the boolean value of target.
|
void |
setUpstreamPathCost(float newPartialPathCost)
Sets the upstream path cost.
|
void |
setVisited(int id)
Mark a RouteNode instance as being visited by a specific integer identifier.
|
String |
toString() |
int |
uniqueDriverCount()
Gets the number of unique drivers.
|
int |
uniqueUserCount()
Gets the number of unique users.
|
void |
updatePresentCongestionCost(float pres_fac)
Updates the present congestion cost based on the present congestion penalty factor.
|
boolean |
willOverUse(NetWrapper netWrapper) |
public static final short capacity
public static final RouteNode[] EMPTY_ARRAY
public static final int initialPresentCongestionCost
public static final int initialHistoricalCongestionCost
public int compareTo(RouteNode that)
compareTo
in interface Comparable<RouteNode>
public boolean isOverUsed()
public boolean willOverUse(NetWrapper netWrapper)
public boolean isUsed()
public boolean hasMultiDrivers()
public static short getLength(Node node)
public void updatePresentCongestionCost(float pres_fac)
pres_fac
- The present congestion penalty factor.public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public boolean isInConnectionBoundingBox(Connection connection)
connection
- The connection that is being routed.public Node getNode()
public boolean isTarget()
public void setTarget(boolean isTarget)
isTarget
- The value to be set.public RouteNodeType getType()
public float getDelay()
public short getBeginTileXCoordinate()
public short getBeginTileYCoordinate()
public short getEndTileXCoordinate()
Node
instance stops at.public short getEndTileYCoordinate()
Tile
instance
that the associated Node
instance stops at.
For bidirectional nodes, the prev member is used to determine the end node.Node
instance stops at.public float getBaseCost()
public RouteNode[] getChildren()
public void resetChildren()
public short getLength()
Node
instance spans.public void setLowerBoundTotalPathCost(float totalPathCost)
totalPathCost
- The cost value to be set.public void setUpstreamPathCost(float newPartialPathCost)
newPartialPathCost
- The new value to be set.public float getLowerBoundTotalPathCost()
public float getUpstreamPathCost()
public Map<NetWrapper,Integer> getUsersConnectionCounts()
RouteNode
instance based on all routed connections.
Each user is a NetWrapper
instance representing a Net
instance.
It is often the case that multiple connections of a net are using a same rnode.
So we count connections of each user to facilitate the sharing mechanism of RWRoute.NetWrapper
instances representing by Net
instances,
and numbers of connections from different users.public void incrementUser(NetWrapper user)
NetWrapper
instance to the user map, of which a key is a NetWrapper
instance and
the value is the number of connections that are using a rnode.
If the user is already stored in the map, increment the connection count of the user by 1. Otherwise, put the user
into the map and initialize the connection count as 1.user
- The user net in question.public int uniqueUserCount()
NetWrapper
instances in the user map, i.e, the key set size of the user map.public void decrementUser(NetWrapper user)
NetWrapper
instance corresponding to a Net
instance.
If there is only one connection of the user that is using a RouteNode instance, remove the user from the map.
Otherwise, decrement the connection count by 1.user
- The user to be decremented from the user map.public int countConnectionsOfUser(NetWrapper user)
user
- The user in question indicated by a NetWrapper
instance.public int uniqueDriverCount()
public void incrementDriver(RouteNode parent)
parent
- The driver to be added.public void decrementDriver(RouteNode parent)
parent
- The driver that should have its count reduced by 1.public int getOccupancy()
public RouteNode getPrev()
public void setPrev(RouteNode prev)
prev
- The driving RouteNode instance to set. Cannot be null.public void clearPrev()
public float getPresentCongestionCost()
public void setPresentCongestionCost(float presentCongestionCost)
presentCongestionCost
- The present congestion cost to be set.public float getHistoricalCongestionCost()
public void setHistoricalCongestionCost(float historicalCongestionCost)
historicalCongestionCost
- The historical congestion cost to be set.public boolean everExpanded()
public boolean isVisited(int id)
id
- Integer identifier.public void setVisited(int id)
id
- Integer identifier.public static boolean isExitNode(Node node)
node
- The node in questionpublic abstract boolean mustInclude(Node parent, Node child)
parent
- The routing arc's parent node.child
- The routing arc's parent node.public abstract boolean isPreserved(Node node)
node
- The node in question.public abstract boolean isExcluded(Node parent, Node child)
parent
- The routing arc's parent node.child
- The routing arc's parent node.public abstract int getSLRIndex()
public boolean getFlag(int index)
index
- Bit index.public void setFlag(int index, boolean value)
index
- Bit index to change.value
- True to set. False to clear.