org.jscience.architecture.traffic.infrastructure
Class NetTunnel

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.NetTunnel
All Implemented Interfaces:
Selectable, SelectionStarter, InstantiationAssistant, TwoStageLoader, XMLSerializable

public class NetTunnel
extends SpecialNode

NetTunnel, our K-r4D 31337 eAsTr egq0r! ph34R uS !!!!!


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jscience.architecture.traffic.infrastructure.Node
Node.NodeStatistics
 
Field Summary
protected  int localPort
          The port on which this this Tunnel should be listening
protected  boolean netInitialized
          Indicates if our network gear is ready for rock 'n roll
protected  boolean paused
          These variables indicate the state of the infra
protected  java.lang.String remoteHostname
          The hostname and port to which this Tunnel should send its Roadusers
protected  int remotePort
          DOCUMENT ME!
protected  java.util.LinkedList sendQueue
          A LinkedList with Roadusers which are waiting to be send to the remote machine
protected  boolean sigStop
          These variables indicate the state of the infra
protected  boolean stopped
          These variables indicate the state of the infra
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
NetTunnel()
          Creates a new NetTunnel object.
NetTunnel(java.awt.Point _coord)
          Creates a new NetTunnel object.
 
Method Summary
 void doStep(SimModel model)
          DOCUMENT ME!
 void enter(Roaduser ru)
          DOCUMENT ME!
 int getLocalPort()
          DOCUMENT ME!
 java.lang.String getName()
          Returns the name of this nettunnel.
 java.lang.String getRemoteHostname()
          DOCUMENT ME!
 int getRemotePort()
          DOCUMENT ME!
 int getSendQueueLength()
          DOCUMENT ME!
 int getType()
          Returns the type of this node
 java.lang.String getXMLName()
          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 processReceive(SimModel model)
          DOCUMENT ME!
 void processSend()
          DOCUMENT ME!
 void receive(XMLElement element)
           
 void reset()
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setLocalPort(int localPort)
          DOCUMENT ME!
 void setRemoteHostname(java.lang.String remoteHostname)
          DOCUMENT ME!
 void setRemotePort(int remotePort)
          DOCUMENT ME!
 void start()
          DOCUMENT ME!
 void stop()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.architecture.traffic.infrastructure.SpecialNode
addRoad, calcDelay, dequeueRoaduser, enqueueRoaduser, 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, placeRoaduser, remAllRoads, remRoad, remRoad, setAlpha, setAlphaRoad, setRoad, setRoadPos, setSigns, setWaitingQueue
 
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

localPort

protected int localPort
The port on which this this Tunnel should be listening


remoteHostname

protected java.lang.String remoteHostname
The hostname and port to which this Tunnel should send its Roadusers


remotePort

protected int remotePort
DOCUMENT ME!


netInitialized

protected boolean netInitialized
Indicates if our network gear is ready for rock 'n roll


sendQueue

protected java.util.LinkedList sendQueue
A LinkedList with Roadusers which are waiting to be send to the remote machine


paused

protected boolean paused
These variables indicate the state of the infra


stopped

protected boolean stopped
These variables indicate the state of the infra


sigStop

protected boolean sigStop
These variables indicate the state of the infra

Constructor Detail

NetTunnel

public NetTunnel()
Creates a new NetTunnel object.


NetTunnel

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

Parameters:
_coord - DOCUMENT ME!
Method Detail

start

public void start()
DOCUMENT ME!

Overrides:
start in class SpecialNode

stop

public void stop()
DOCUMENT ME!

Overrides:
stop in class SpecialNode

enter

public void enter(Roaduser ru)
DOCUMENT ME!

Overrides:
enter in class SpecialNode
Parameters:
ru - DOCUMENT ME!

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!

loadSecondStage

public void loadSecondStage(java.util.Dictionary dictionaries)
                     throws XMLInvalidInputException,
                            XMLTreeException
DOCUMENT ME!

Specified by:
loadSecondStage in interface TwoStageLoader
Overrides:
loadSecondStage in class SpecialNode
Parameters:
dictionaries - DOCUMENT ME!
Throws:
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - 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 nettunnel.

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

getRemoteHostname

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

Returns:
DOCUMENT ME!

getLocalPort

public int getLocalPort()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getRemotePort

public int getRemotePort()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setRemoteHostname

public void setRemoteHostname(java.lang.String remoteHostname)
                       throws SimulationRunningException
DOCUMENT ME!

Parameters:
remoteHostname - DOCUMENT ME!
Throws:
SimulationRunningException - DOCUMENT ME!

setLocalPort

public void setLocalPort(int localPort)
                  throws SimulationRunningException
DOCUMENT ME!

Parameters:
localPort - DOCUMENT ME!
Throws:
SimulationRunningException - DOCUMENT ME!

setRemotePort

public void setRemotePort(int remotePort)
                   throws SimulationRunningException
DOCUMENT ME!

Parameters:
remotePort - DOCUMENT ME!
Throws:
SimulationRunningException - DOCUMENT ME!

reset

public void reset()
DOCUMENT ME!

Overrides:
reset in class SpecialNode
See Also:
Road.reset()

getSendQueueLength

public int getSendQueueLength()
DOCUMENT ME!

Returns:
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!

receive

public void receive(XMLElement element)
             throws XMLInvalidInputException,
                    InfraException
Throws:
XMLInvalidInputException
InfraException

doStep

public void doStep(SimModel model)
DOCUMENT ME!

Overrides:
doStep in class SpecialNode
Parameters:
model - DOCUMENT ME!

processReceive

public void processReceive(SimModel model)
                    throws InfraException
DOCUMENT ME!

Parameters:
model - DOCUMENT ME!
Throws:
InfraException - DOCUMENT ME!

processSend

public void processSend()
                 throws java.io.IOException,
                        XMLCannotSaveException,
                        XMLTreeException
DOCUMENT ME!

Throws:
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!