|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.infrastructure.Node
org.jscience.architecture.traffic.infrastructure.SpecialNode
public abstract class SpecialNode
Class with common code for NetTunnels and EdgeNodes
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jscience.architecture.traffic.infrastructure.Node |
|---|
Node.NodeStatistics |
| Field Summary | |
|---|---|
protected boolean |
isAlpha
True if the connected road is an alpha road |
protected org.jscience.architecture.traffic.infrastructure.SpecialNode.TwoStageLoaderData |
loadData
Temporary data structure to tranfer info from the first stage loader to the second stage loader |
protected Road |
road
The road this SpecialNode is connected to |
protected int |
roadPos
The connection-position of the connected road |
protected java.util.LinkedList |
waitingQueue
The queue with all road users which have not entered the road. |
| Fields inherited from class org.jscience.architecture.traffic.infrastructure.Node |
|---|
C_DOWN, C_LEFT, C_RIGHT, C_UP, coord, D_AHEAD, D_BACK, D_LEFT, D_RIGHT, EDGE, inboundLanes, JUNCTION, NET_TUNNEL, nodeId, NON_TL, outboundLanes, parentName, spdata, STAT_NUM_DATA, statistics |
| Constructor Summary | |
|---|---|
SpecialNode()
Creates a new SpecialNode object. |
|
SpecialNode(java.awt.Point _coord)
Creates a new SpecialNode object. |
|
| Method Summary | |
|---|---|
void |
addRoad(Road r,
int pos)
DOCUMENT ME! |
protected int |
calcDelay(Roaduser ru,
int stop,
int distance)
Calculates the delay that has to be logged for this Node. |
Roaduser |
dequeueRoaduser()
Remove a roaduser from the waitingQueue |
void |
doStep(SimModel model)
|
void |
enqueueRoaduser(Roaduser ru)
Place a roaduser in the waitingQueue |
void |
enter(Roaduser ru)
Hook method that is called by the infra when a roaduser reaches this node |
Drivelane[] |
getAllLanes()
DOCUMENT ME! |
Road[] |
getAllRoads()
Returns all roads connected to this node |
boolean |
getAlpha()
Returns true if the road is an alpha road |
Road[] |
getAlphaRoads()
Returns the alpha roads connected to this node |
int |
getDesiredSignType()
DOCUMENT ME! |
Drivelane[] |
getInboundLanes()
DOCUMENT ME! |
Drivelane[] |
getLanesLeadingFrom(Drivelane lane,
int ruType)
DOCUMENT ME! |
Drivelane[] |
getLanesLeadingTo(Drivelane lane,
int ruType)
DOCUMENT ME! |
int |
getNumAllLanes()
DOCUMENT ME! |
int |
getNumAlphaRoads()
DOCUMENT ME! |
int |
getNumInboundLanes()
DOCUMENT ME! |
int |
getNumOutboundLanes()
DOCUMENT ME! |
int |
getNumRealSigns()
DOCUMENT ME! |
int |
getNumRoads()
DOCUMENT ME! |
int |
getNumSigns()
DOCUMENT ME! |
Drivelane[] |
getOutboundLanes()
DOCUMENT ME! |
Road |
getRoad()
Returns the road this SpecialNode is connected to |
int |
getRoadPos()
Returns the position of the road |
java.util.LinkedList |
getWaitingQueue()
Returns the queue with waiting road users for this node |
int |
getWaitingQueueLength()
Get the number of waiting road users, i.e. the length of the waitingQueue |
int |
getWidth()
DOCUMENT ME! |
java.lang.String |
getXMLName()
DOCUMENT ME! |
boolean |
isAlphaRoad(Road r)
Checks if the given road is an alpha road of this node. |
boolean |
isConnected(Road r)
DOCUMENT ME! |
int |
isConnectedAt(Road r)
DOCUMENT ME! |
boolean |
isConnectionPosFree(int pos)
DOCUMENT ME! |
void |
load(XMLElement myElement,
XMLLoader loader)
Load this XMLSerializable |
void |
loadSecondStage(java.util.Dictionary dictionaries)
DOCUMENT ME! |
void |
placeRoaduser(Roaduser ru)
Place a roaduser in one of the outbound queues |
void |
remAllRoads()
DOCUMENT ME! |
void |
remRoad(int pos)
DOCUMENT ME! |
void |
remRoad(Road r)
DOCUMENT ME! |
void |
reset()
Resets the data of this node. |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setAlpha(boolean f)
Sets the isAlpha flag |
void |
setAlphaRoad(int pos)
DOCUMENT ME! |
void |
setRoad(Road r)
Sets the road this SpecialNode is connected to |
void |
setRoadPos(int pos)
Sets the position of the road |
void |
setSigns(Sign[] s)
DOCUMENT ME! |
void |
setWaitingQueue(java.util.LinkedList l)
Sets a new queue with waiting road users |
void |
start()
Hook method for stuff that has to be done when the simulation is started |
void |
stop()
Hook method for stuff that has to be done when the simulation is stopped |
| Methods inherited from class org.jscience.architecture.traffic.infrastructure.Node |
|---|
addShortestPath, areAllTailsFree, canCreateInstance, createInstance, getBounds, getCenterPoint, getChildren, getComplexBounds, getCoord, getDirection, getDistance, getId, getName, getNumSkip, getSelectionPoint, getSelectionPoints, getShortestPathDestinations, getShortestPaths, getStatistics, getStatistics, getType, hasChildren, initStats, isSelectable, paint, paint, processStats, remPaths, resetStats, setCoord, setId, setParentName, setShortestPath, updateLanes, zapShortestPaths |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jscience.architecture.traffic.xml.XMLSerializable |
|---|
setParentName |
| Field Detail |
|---|
protected Road road
protected boolean isAlpha
protected int roadPos
protected java.util.LinkedList waitingQueue
protected org.jscience.architecture.traffic.infrastructure.SpecialNode.TwoStageLoaderData loadData
| Constructor Detail |
|---|
public SpecialNode()
public SpecialNode(java.awt.Point _coord)
_coord - DOCUMENT ME!| Method Detail |
|---|
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
XMLSerializable
load in interface XMLSerializableload in class NodemyElement - The XMLElement which represents this object in the XML
tree. It can contain attributes which hold information about the
object.loader - The XMLLoader which this XMLSerializable can use to load
child objects.
XMLTreeException - The parser can throw this exception if it is
called by the XMLSerializable. The XMLSerializable should NOT
throw this exception by itself and preferrably not catch it
too.
java.io.IOException - Thrown in case of an read error in the XML file.
XMLInvalidInputException - The XMLSerializable can throw this
exception if it cannot load itself or one of its child objects
for whatever reason.
public XMLElement saveSelf()
throws XMLCannotSaveException
saveSelf in interface XMLSerializablesaveSelf in class NodeXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaveChilds in class Nodesaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public java.lang.String getXMLName()
getXMLName in interface XMLSerializable
public void loadSecondStage(java.util.Dictionary dictionaries)
throws XMLInvalidInputException,
XMLTreeException
loadSecondStage in interface TwoStageLoaderloadSecondStage in class Nodedictionaries - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!public Road getRoad()
public void setRoad(Road r)
throws InfraException
r - DOCUMENT ME!
InfraException - DOCUMENT ME!public int getRoadPos()
public void setRoadPos(int pos)
throws InfraException
pos - DOCUMENT ME!
InfraException - DOCUMENT ME!public boolean getAlpha()
public void setAlpha(boolean f)
f - DOCUMENT ME!public Road[] getAllRoads()
getAllRoads in class Nodepublic Road[] getAlphaRoads()
getAlphaRoads in class Nodepublic int getWidth()
getWidth in class Node
public void placeRoaduser(Roaduser ru)
throws InfraException
ru - DOCUMENT ME!
InfraException - DOCUMENT ME!public java.util.LinkedList getWaitingQueue()
public void setWaitingQueue(java.util.LinkedList l)
l - DOCUMENT ME!public int getWaitingQueueLength()
public void enqueueRoaduser(Roaduser ru)
ru - DOCUMENT ME!public Roaduser dequeueRoaduser()
protected int calcDelay(Roaduser ru,
int stop,
int distance)
Node
calcDelay in class Noderu - DOCUMENT ME!stop - DOCUMENT ME!distance - DOCUMENT ME!
public void reset()
Node
reset in class NodeRoad.reset()
public void addRoad(Road r,
int pos)
throws InfraException
addRoad in class Noder - DOCUMENT ME!pos - DOCUMENT ME!
InfraException - DOCUMENT ME!
public void setAlphaRoad(int pos)
throws InfraException
setAlphaRoad in class Nodepos - DOCUMENT ME!
InfraException - DOCUMENT ME!
public void remRoad(int pos)
throws InfraException
remRoad in class Nodepos - DOCUMENT ME!
InfraException - DOCUMENT ME!
public void remRoad(Road r)
throws InfraException
remRoad in class Noder - DOCUMENT ME!
InfraException - DOCUMENT ME!
public void remAllRoads()
throws InfraException
remAllRoads in class NodeInfraException - DOCUMENT ME!
public void setSigns(Sign[] s)
throws InfraException
setSigns in class Nodes - DOCUMENT ME!
InfraException - DOCUMENT ME!
public int getDesiredSignType()
throws InfraException
getDesiredSignType in class NodeInfraException - DOCUMENT ME!
public boolean isAlphaRoad(Road r)
throws InfraException
Node
isAlphaRoad in class Noder - The road to check
InfraException - if r is null
public boolean isConnected(Road r)
throws InfraException
isConnected in class Noder - DOCUMENT ME!
InfraException - DOCUMENT ME!
public int isConnectedAt(Road r)
throws InfraException
isConnectedAt in class Noder - DOCUMENT ME!
InfraException - DOCUMENT ME!
public boolean isConnectionPosFree(int pos)
throws InfraException
isConnectionPosFree in class Nodepos - DOCUMENT ME!
InfraException - DOCUMENT ME!public int getNumRoads()
getNumRoads in class Nodepublic int getNumAlphaRoads()
getNumAlphaRoads in class Node
public int getNumInboundLanes()
throws InfraException
getNumInboundLanes in class NodeInfraException - DOCUMENT ME!
public int getNumOutboundLanes()
throws InfraException
getNumOutboundLanes in class NodeInfraException - DOCUMENT ME!public int getNumAllLanes()
getNumAllLanes in class Nodepublic int getNumSigns()
getNumSigns in class Nodepublic int getNumRealSigns()
getNumRealSigns in class Node
public Drivelane[] getLanesLeadingTo(Drivelane lane,
int ruType)
throws InfraException
getLanesLeadingTo in class Nodelane - DOCUMENT ME!ruType - DOCUMENT ME!
InfraException - DOCUMENT ME!
public Drivelane[] getLanesLeadingFrom(Drivelane lane,
int ruType)
throws InfraException
getLanesLeadingFrom in class Nodelane - DOCUMENT ME!ruType - DOCUMENT ME!
InfraException - DOCUMENT ME!
public Drivelane[] getOutboundLanes()
throws InfraException
getOutboundLanes in class NodeInfraException - DOCUMENT ME!
public Drivelane[] getInboundLanes()
throws InfraException
getInboundLanes in class NodeInfraException - DOCUMENT ME!
public Drivelane[] getAllLanes()
throws InfraException
getAllLanes in class NodeInfraException - DOCUMENT ME!public void doStep(SimModel model)
public void start()
public void stop()
public void enter(Roaduser ru)
ru - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||