|
|||||||||
| 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.Junction
public class Junction
Basic junction. A Node either is a Junction or an EdgeNode.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jscience.architecture.traffic.infrastructure.Node |
|---|
Node.NodeStatistics |
| Field Summary | |
|---|---|
protected Road[] |
allRoads
A vector containing all roads connected to this node |
protected Road[] |
alphaRoads
A vector containing all roads that have this node as their Alpha node |
protected org.jscience.architecture.traffic.infrastructure.Junction.TwoStageLoaderData |
loadData
Temporary data structure to tranfer info from the first stage loader to the second stage loader |
protected Sign[][] |
signconfigs
Contains all possible combinations of signs which may be turned green at the same time |
protected Sign[] |
signs
A Vector containing all Signs on this node |
protected static int |
type
The type of this node |
protected int |
width
The width/height of this node in drivelanes. |
| 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 | |
|---|---|
Junction()
Creates an empty junction (for loading) |
|
Junction(java.awt.Point _coord)
Creates a new standard Junction |
|
| Method Summary | |
|---|---|
void |
addRoad(Road r,
int pos)
DOCUMENT ME! |
void |
addSignconfig(Sign[] conf)
Adds a sign configuration |
boolean |
areOtherTailsFree(Sign[] mayUse)
|
protected int |
calcDelay(Roaduser ru,
int stop,
int distance)
Calculates the delay that has to be logged for this Node. |
void |
calculateWidth()
(Re)Calculates the width of this junction |
Drivelane[] |
getAllLanes()
Returns an array of all lanes on this node |
Drivelane[] |
getAllLanesCW(Drivelane lane)
Returns an array of all lanes connected to this node, in clock-wise order, starting at the given lane |
Road[] |
getAllRoads()
Returns all roads connected to this node |
Road[] |
getAlphaRoads()
Returns the alpha roads connected to this node |
int |
getDesiredSignType()
DOCUMENT ME! |
Drivelane[] |
getInboundLanes()
Returns an array of all inbound lanes on this junction |
Drivelane[] |
getLanesLeadingFrom(Drivelane lane)
DOCUMENT ME! |
Drivelane[] |
getLanesLeadingFrom(Drivelane lane,
int ruType)
Returns an array of all outbound lanes supporting roadusers of given type that can be reached from the given inbound lane. |
Drivelane[] |
getLanesLeadingTo(Drivelane lane,
int ruType)
Returns an array of all inbound lanes supporting roadusers of given type that lead to the given outbound lane. |
java.lang.String |
getName()
Returns the name of this junction. |
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()
Returns an array of all outbound lanes on this junction |
protected int[] |
getRoadIdArray()
DOCUMENT ME! |
protected Sign |
getSign(java.util.Dictionary laneDictionary,
int id)
DOCUMENT ME! |
protected int[][] |
getSignConfigIdArray()
DOCUMENT ME! |
Sign[][] |
getSignConfigs()
Returns all possible sign configurations |
protected int[] |
getSignIdArray()
DOCUMENT ME! |
Sign[] |
getSigns()
Returns the signs on this Node |
int |
getType()
Returns the type of this junction |
int |
getWidth()
Returns the width of this Node in number of lanes |
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 |
paint(java.awt.Graphics g)
DOCUMENT ME! |
void |
paint(java.awt.Graphics g,
int x,
int y,
float zf)
DOCUMENT ME! |
void |
paint(java.awt.Graphics g,
int x,
int y,
float zf,
double bogus)
DOCUMENT ME! |
void |
remAllRoads()
DOCUMENT ME! |
void |
remRoad(int pos)
DOCUMENT ME! |
void |
remRoad(Road r)
DOCUMENT ME! |
void |
remSignconfig(Sign[] conf)
Removes a sign configuration |
void |
reset()
Resets the data of this node. |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setAllRoads(Road[] r)
Sets the array that contains all roads connected to this node |
void |
setAlphaRoad(int pos)
DOCUMENT ME! |
void |
setAlphaRoads(Road[] r)
Sets the alpha roads connected to this node |
void |
setSignConfigs(Sign[][] s)
Sets all possible sign configurations |
void |
setSigns(Sign[] s)
Sets the signs on this Node |
void |
setWidth(int max)
Sets the width of this Node in number of lanes |
| Methods inherited from class org.jscience.architecture.traffic.infrastructure.Node |
|---|
addShortestPath, areAllTailsFree, canCreateInstance, createInstance, getBounds, getCenterPoint, getChildren, getComplexBounds, getCoord, getDirection, getDistance, getId, getNumSkip, getSelectionPoint, getSelectionPoints, getShortestPathDestinations, getShortestPaths, getStatistics, getStatistics, hasChildren, initStats, isSelectable, 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 |
| Field Detail |
|---|
protected static final int type
protected int width
protected Road[] allRoads
protected Road[] alphaRoads
protected Sign[] signs
protected Sign[][] signconfigs
protected org.jscience.architecture.traffic.infrastructure.Junction.TwoStageLoaderData loadData
| Constructor Detail |
|---|
public Junction()
public Junction(java.awt.Point _coord)
_coord - The coordinates of this node on the map in pixels.| Method Detail |
|---|
public int getType()
getType in class Nodepublic java.lang.String getName()
getName in class Nodepublic Road[] getAllRoads()
getAllRoads in class Node
public void setAllRoads(Road[] r)
throws InfraException
r - DOCUMENT ME!
InfraException - DOCUMENT ME!public Road[] getAlphaRoads()
getAlphaRoads in class Node
public void setAlphaRoads(Road[] r)
throws InfraException
r - DOCUMENT ME!
InfraException - DOCUMENT ME!public Sign[][] getSignConfigs()
public void setSignConfigs(Sign[][] s)
s - DOCUMENT ME!public Sign[] getSigns()
public void setSigns(Sign[] s)
throws InfraException
setSigns in class Nodes - DOCUMENT ME!
InfraException - DOCUMENT ME!public int getWidth()
getWidth in class Nodepublic void setWidth(int max)
max - DOCUMENT ME!
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 addSignconfig(Sign[] conf)
throws InfraException
conf - DOCUMENT ME!
InfraException - DOCUMENT ME!
public void remSignconfig(Sign[] conf)
throws InfraException
conf - DOCUMENT ME!
InfraException - 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 int getDesiredSignType()
throws InfraException
getDesiredSignType in class NodeInfraException - DOCUMENT ME!
public Drivelane[] getLanesLeadingTo(Drivelane lane,
int ruType)
throws InfraException
Node
getLanesLeadingTo in class Nodelane - Outbound lane the lanes lead toruType - The type of roaduser the inbound lanes should support
InfraException - if the given lane is not an outbound lane on this
node
public Drivelane[] getLanesLeadingFrom(Drivelane lane,
int ruType)
throws InfraException
Node
getLanesLeadingFrom in class Nodelane - Inbound laneruType - The type of roaduser the outbound lanes should support
InfraException - if the given lane is not an inbound lane on this
node
public Drivelane[] getLanesLeadingFrom(Drivelane lane)
throws InfraException
lane - 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
Node
getAllLanes in class NodeInfraException - DOCUMENT ME!
public Drivelane[] getAllLanesCW(Drivelane lane)
throws InfraException
lane - DOCUMENT ME!
InfraException - DOCUMENT ME!public boolean areOtherTailsFree(Sign[] mayUse)
public void paint(java.awt.Graphics g)
throws TrafficException
paint in class Nodeg - DOCUMENT ME!
TrafficException - DOCUMENT ME!
public void paint(java.awt.Graphics g,
int x,
int y,
float zf)
throws TrafficException
paint in class Nodeg - DOCUMENT ME!x - DOCUMENT ME!y - DOCUMENT ME!zf - DOCUMENT ME!
TrafficException - DOCUMENT ME!
public void paint(java.awt.Graphics g,
int x,
int y,
float zf,
double bogus)
throws TrafficException
g - DOCUMENT ME!x - DOCUMENT ME!y - DOCUMENT ME!zf - DOCUMENT ME!bogus - DOCUMENT ME!
TrafficException - DOCUMENT ME!public void calculateWidth()
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!protected int[] getSignIdArray()
protected int[] getRoadIdArray()
protected int[][] getSignConfigIdArray()
public java.lang.String getXMLName()
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!
protected Sign getSign(java.util.Dictionary laneDictionary,
int id)
laneDictionary - DOCUMENT ME!id - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||