org.jscience.architecture.traffic.infrastructure
Class EdgeNode

java.lang.Object
  extended by org.jscience.architecture.traffic.infrastructure.Node
      extended by org.jscience.architecture.traffic.infrastructure.SpecialNode
          extended by org.jscience.architecture.traffic.infrastructure.EdgeNode
All Implemented Interfaces:
Selectable, SelectionStarter, InstantiationAssistant, TwoStageLoader, XMLSerializable

public class EdgeNode
extends SpecialNode

EdgeNode, a node used as starting and end point for Roadusers.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jscience.architecture.traffic.infrastructure.Node
Node.NodeStatistics
 
Field Summary
protected  DestFrequency[][] destFreq
          The frequency with which spawned roadusers choose specific destinations
protected  SpawnFrequency[] spawnFreq
          The frequency at which various roadusers spawn
protected static int type
          The type of this node
 
Fields inherited from class org.jscience.architecture.traffic.infrastructure.SpecialNode
isAlpha, loadData, road, roadPos, waitingQueue
 
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
EdgeNode()
          Creates a new EdgeNode object.
EdgeNode(java.awt.Point _coord)
          Creates a new EdgeNode object.
 
Method Summary
 DestFrequency[][] getDestFrequencies()
          Returns the array of arrays of Destination Frequenties
 float getDestFrequency(int edgeId, int ruType)
          Returns the destination frequency for certain destination edgenode and roaduser type.
 java.lang.String getName()
          Returns the name of this edgenode.
 SpawnFrequency[] getSpawnFrequencies()
          Returns the array of Spawning Frequenties
 float getSpawnFrequency(int ruType)
          Returns the spawn freqeuncy for the Roadusers of type ruType
 int getType()
          Returns the type of this node
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          Load this XMLSerializable
 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 saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setDestFrequencies(DestFrequency[][] dests)
          Sets the Destination Frequencies
 void setDestFrequency(int edgeId, int ruType, float dest)
          Sets the destination frequency for certain destination edgenode and roaduser type.
 void setSpawnFrequencies(SpawnFrequency[] spawns)
          Sets the Spawning Frequencies
 void setSpawnFrequency(int ruType, float freq)
          Sets the spawn frequency for Roadusers of type ruType
 
Methods inherited from class org.jscience.architecture.traffic.infrastructure.SpecialNode
addRoad, calcDelay, dequeueRoaduser, doStep, enqueueRoaduser, enter, getAllLanes, getAllRoads, getAlpha, getAlphaRoads, getDesiredSignType, getInboundLanes, getLanesLeadingFrom, getLanesLeadingTo, getNumAllLanes, getNumAlphaRoads, getNumInboundLanes, getNumOutboundLanes, getNumRealSigns, getNumRoads, getNumSigns, getOutboundLanes, getRoad, getRoadPos, getWaitingQueue, getWaitingQueueLength, getWidth, isAlphaRoad, isConnected, isConnectedAt, isConnectionPosFree, loadSecondStage, placeRoaduser, remAllRoads, remRoad, remRoad, reset, setAlpha, setAlphaRoad, setRoad, setRoadPos, setSigns, setWaitingQueue, start, stop
 
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
 
Methods inherited from interface org.jscience.architecture.traffic.xml.XMLSerializable
setParentName
 

Field Detail

type

protected static final int type
The type of this node

See Also:
Constant Field Values

spawnFreq

protected SpawnFrequency[] spawnFreq
The frequency at which various roadusers spawn


destFreq

protected DestFrequency[][] destFreq
The frequency with which spawned roadusers choose specific destinations

Constructor Detail

EdgeNode

public EdgeNode()
Creates a new EdgeNode object.


EdgeNode

public EdgeNode(java.awt.Point _coord)
Creates a new EdgeNode object.

Parameters:
_coord - DOCUMENT ME!
Method Detail

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
Description copied from interface: XMLSerializable
Load this XMLSerializable

Specified by:
load in interface XMLSerializable
Overrides:
load in class SpecialNode
Parameters:
myElement - 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.
Throws:
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.

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Overrides:
saveSelf in class SpecialNode
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveChilds in interface XMLSerializable
Overrides:
saveChilds in class SpecialNode
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

getXMLName

public java.lang.String getXMLName()
DOCUMENT ME!

Specified by:
getXMLName in interface XMLSerializable
Overrides:
getXMLName in class SpecialNode
Returns:
DOCUMENT ME!

getType

public int getType()
Returns the type of this node

Specified by:
getType in class Node
Returns:
DOCUMENT ME!

getName

public java.lang.String getName()
Returns the name of this edgenode.

Specified by:
getName in class Node
Returns:
DOCUMENT ME!

getSpawnFrequencies

public SpawnFrequency[] getSpawnFrequencies()
Returns the array of Spawning Frequenties

Returns:
DOCUMENT ME!

setSpawnFrequencies

public void setSpawnFrequencies(SpawnFrequency[] spawns)
Sets the Spawning Frequencies

Parameters:
spawns - DOCUMENT ME!

getDestFrequencies

public DestFrequency[][] getDestFrequencies()
Returns the array of arrays of Destination Frequenties

Returns:
DOCUMENT ME!

setDestFrequencies

public void setDestFrequencies(DestFrequency[][] dests)
Sets the Destination Frequencies

Parameters:
dests - DOCUMENT ME!

getSpawnFrequency

public float getSpawnFrequency(int ruType)
Returns the spawn freqeuncy for the Roadusers of type ruType

Parameters:
ruType - DOCUMENT ME!
Returns:
DOCUMENT ME!

setSpawnFrequency

public void setSpawnFrequency(int ruType,
                              float freq)
Sets the spawn frequency for Roadusers of type ruType

Parameters:
ruType - DOCUMENT ME!
freq - DOCUMENT ME!

getDestFrequency

public float getDestFrequency(int edgeId,
                              int ruType)
Returns the destination frequency for certain destination edgenode and roaduser type.

Parameters:
edgeId - DOCUMENT ME!
ruType - DOCUMENT ME!
Returns:
DOCUMENT ME!

setDestFrequency

public void setDestFrequency(int edgeId,
                             int ruType,
                             float dest)
Sets the destination frequency for certain destination edgenode and roaduser type.

Parameters:
edgeId - DOCUMENT ME!
ruType - DOCUMENT ME!
dest - DOCUMENT ME!

paint

public void paint(java.awt.Graphics g)
           throws TrafficException
Description copied from class: Node
DOCUMENT ME!

Specified by:
paint in class Node
Parameters:
g - DOCUMENT ME!
Throws:
TrafficException - DOCUMENT ME!

paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  float zf)
           throws TrafficException
DOCUMENT ME!

Specified by:
paint in class Node
Parameters:
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
zf - DOCUMENT ME!
Throws:
TrafficException - DOCUMENT ME!

paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  float zf,
                  double bogus)
           throws TrafficException
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
zf - DOCUMENT ME!
bogus - DOCUMENT ME!
Throws:
TrafficException - DOCUMENT ME!