|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.infrastructure.Roaduser
public abstract class Roaduser
Basic Roaduser
| Field Summary | |
|---|---|
protected java.awt.Color |
color
The color of this Roaduser |
protected int |
cycleAsked
The last cycle this Roaduser was asked when it had last moved |
protected int |
cycleMoved
The last cycle this Roaduser moved |
protected int |
delay
The delay experienced so far |
protected Node |
destNode
The node that is the destination of this Roaduser |
protected int |
drivelaneStartTime
The starttime on this lane |
protected boolean |
inQueueForSign
DOCUMENT ME! |
protected org.jscience.architecture.traffic.infrastructure.Roaduser.TwoStageLoaderData |
loadData
Stuff to transfer between the first and second stage loader |
protected java.lang.String |
parentName
The name of the parent of this Roaduser |
protected int |
position
The position of this Roaduser on the drivelane. |
protected int |
prevSign
The SignID of the lane this Roaduser came from |
protected int |
prevWaitPos
The id of the sign this roaduser last passed |
protected int |
prevWaitTl
The id of the sign this roaduser last passed |
protected boolean |
prevWaitTlColor
The id of the sign this roaduser last passed |
protected Node |
startNode
The node this Roaduser spawned at |
protected boolean |
voted
DOCUMENT ME! |
protected int |
waitPos
The id of the sign this roaduser last passed |
protected int |
waitTl
The id of the sign this roaduser last passed |
protected boolean |
waitTlColor
The id of the sign this roaduser last passed |
| Constructor Summary | |
|---|---|
Roaduser()
Creates a new Roaduser object. |
|
Roaduser(Node _startNode,
Node _destNode,
int pos)
Creates a new Roaduser object. |
|
| Method Summary | |
|---|---|
void |
addDelay(int d)
Add a given delay to the total delay already experienced |
java.lang.Object |
clone()
DOCUMENT ME! |
boolean |
didMove(int cycleNow)
DOCUMENT ME! |
boolean |
didVote()
DOCUMENT ME! |
java.awt.Rectangle |
getBounds()
Returns the bounding box of this Selectable |
java.awt.Point |
getCenterPoint()
DOCUMENT ME! |
java.util.Enumeration |
getChildren()
DOCUMENT ME! |
java.awt.Color |
getColor()
Returns the color of this Roaduser |
java.awt.Shape |
getComplexBounds()
DOCUMENT ME! |
int |
getCurrentWaitPos()
Gets the current waiting point's position relative to the sign |
int |
getCurrentWaitTl()
Gets the current waiting point's sign |
boolean |
getCurrentWaitTlColor()
Gets the current waiting point's sign |
int |
getCycleAsked()
Returns the last cycle this Roaduser was asked about its movements |
int |
getCycleMoved()
Returns the last cycle this Roaduser moved |
int |
getDelay()
Returns the distance experienced so far |
java.lang.String |
getDescription()
DOCUMENT ME! |
Node |
getDestNode()
Returns the destination Node of this Roaduser |
int |
getDistance(java.awt.Point p)
DOCUMENT ME! |
int |
getDrivelaneStartTime()
Returns the start time of this Roaduser in the current drivelane |
java.lang.String |
getDriverName()
DOCUMENT ME! |
boolean |
getInQueueForSign()
DOCUMENT ME! |
abstract int |
getLength()
DOCUMENT ME! |
abstract java.lang.String |
getName()
DOCUMENT ME! |
abstract int |
getNumPassengers()
DOCUMENT ME! |
java.lang.String |
getPicture()
DOCUMENT ME! |
int |
getPosition()
Returns the position of this Roaduser on the current Drivelane |
int |
getPrevSign()
Returns the Id of the previous lane this Roaduser hit |
int |
getPrevWaitPos()
Gets the last waiting point's position relative to the sign |
int |
getPrevWaitTl()
Gets the last waiting point's sign |
boolean |
getPrevWaitTlColor()
Gets the last waiting point's sign |
java.awt.Point |
getSelectionPoint()
DOCUMENT ME! |
java.awt.Point[] |
getSelectionPoints()
DOCUMENT ME! |
java.lang.String |
getSound()
DOCUMENT ME! |
abstract int |
getSpeed()
DOCUMENT ME! |
Node |
getStartNode()
Returns the start Node of this Roaduser |
abstract int |
getType()
DOCUMENT ME! |
java.lang.String |
getVehicleName()
DOCUMENT ME! |
boolean |
hasChildren()
DOCUMENT ME! |
boolean |
isSelectable()
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 dx,
int dy,
double angle)
DOCUMENT ME! |
abstract void |
paint(java.awt.Graphics g,
int dx,
int dy,
float zf)
DOCUMENT ME! |
abstract void |
paint(java.awt.Graphics g,
int dx,
int dy,
float zf,
double angle)
DOCUMENT ME! |
void |
resetStats()
DOCUMENT ME! |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setColor(java.awt.Color c)
Sets the color of this Roaduser |
void |
setCycleAsked(int cycle)
Sets the last cycle this Roaduser was asked its movements |
void |
setCycleMoved(int cycle)
Sets the last cycle this Roaduser moved |
void |
setDelay(int delay)
Sets a new delay |
void |
setDestNode(Node n)
Sets the destination Node of this Roaduser |
void |
setDrivelaneStartTime(int time)
Sets the start time of this Roaduser on the current Drivelane |
void |
setInQueueForSign(boolean b)
DOCUMENT ME! |
void |
setParentName(java.lang.String parentName)
DOCUMENT ME! |
void |
setPosition(int pos)
Sets the position of this Roaduser on the current Drivelane |
void |
setPrevSign(int _prevSign)
Sets the Id of the previous lane this Roaduser hit |
void |
setStartNode(Node n)
Sets the start Node of this Roaduser |
void |
setVoted(boolean v)
DOCUMENT ME! |
void |
setWaitPos(int tlId,
boolean b,
int pos)
Sets the last waiting point's position relative to the sign |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jscience.architecture.traffic.xml.XMLSerializable |
|---|
getXMLName |
| Field Detail |
|---|
protected Node startNode
protected Node destNode
protected int cycleMoved
protected int cycleAsked
protected int position
protected int prevSign
protected int drivelaneStartTime
protected int delay
protected org.jscience.architecture.traffic.infrastructure.Roaduser.TwoStageLoaderData loadData
protected java.awt.Color color
protected java.lang.String parentName
protected int waitTl
protected int waitPos
protected boolean waitTlColor
protected int prevWaitTl
protected int prevWaitPos
protected boolean prevWaitTlColor
protected boolean voted
protected boolean inQueueForSign
| Constructor Detail |
|---|
public Roaduser(Node _startNode,
Node _destNode,
int pos)
_startNode - DOCUMENT ME!_destNode - DOCUMENT ME!pos - DOCUMENT ME!public Roaduser()
| Method Detail |
|---|
public void setInQueueForSign(boolean b)
b - DOCUMENT ME!public boolean getInQueueForSign()
public void resetStats()
public java.lang.Object clone()
clone in class java.lang.Objectpublic Node getStartNode()
public void setStartNode(Node n)
n - DOCUMENT ME!public Node getDestNode()
public void setDestNode(Node n)
n - DOCUMENT ME!public int getPosition()
public void setPosition(int pos)
pos - DOCUMENT ME!public int getCycleMoved()
public void setCycleMoved(int cycle)
cycle - DOCUMENT ME!public int getCycleAsked()
public void setCycleAsked(int cycle)
cycle - DOCUMENT ME!public int getDrivelaneStartTime()
public void setDrivelaneStartTime(int time)
time - DOCUMENT ME!public int getDelay()
public void addDelay(int d)
d - DOCUMENT ME!public void setDelay(int delay)
delay - DOCUMENT ME!public int getPrevSign()
public void setPrevSign(int _prevSign)
_prevSign - DOCUMENT ME!public java.awt.Color getColor()
public void setColor(java.awt.Color c)
c - DOCUMENT ME!
public void setWaitPos(int tlId,
boolean b,
int pos)
tlId - DOCUMENT ME!b - DOCUMENT ME!pos - DOCUMENT ME!public int getPrevWaitPos()
public int getPrevWaitTl()
public boolean getPrevWaitTlColor()
public int getCurrentWaitTl()
public int getCurrentWaitPos()
public boolean getCurrentWaitTlColor()
public boolean didVote()
public void setVoted(boolean v)
v - DOCUMENT ME!public boolean didMove(int cycleNow)
cycleNow - DOCUMENT ME!
public abstract java.lang.String getName()
public abstract int getNumPassengers()
public abstract int getLength()
public abstract int getSpeed()
public abstract int getType()
public java.lang.String getVehicleName()
public java.lang.String getDriverName()
public java.lang.String getDescription()
public java.lang.String getPicture()
public java.lang.String getSound()
public java.awt.Rectangle getBounds()
Selectable
getBounds in interface Selectablepublic java.awt.Shape getComplexBounds()
getComplexBounds in interface Selectablepublic int getDistance(java.awt.Point p)
getDistance in interface Selectablep - DOCUMENT ME!
public java.awt.Point getSelectionPoint()
getSelectionPoint in interface Selectablepublic java.awt.Point[] getSelectionPoints()
getSelectionPoints in interface Selectablepublic java.awt.Point getCenterPoint()
getCenterPoint in interface Selectablepublic boolean isSelectable()
isSelectable in interface Selectablepublic boolean hasChildren()
hasChildren in interface SelectionStarterpublic java.util.Enumeration getChildren()
getChildren in interface SelectionStarter
public void paint(java.awt.Graphics g)
throws TrafficException
g - DOCUMENT ME!
TrafficException - DOCUMENT ME!
public void paint(java.awt.Graphics g,
int dx,
int dy,
double angle)
throws TrafficException
g - DOCUMENT ME!dx - DOCUMENT ME!dy - DOCUMENT ME!angle - DOCUMENT ME!
TrafficException - DOCUMENT ME!
public abstract void paint(java.awt.Graphics g,
int dx,
int dy,
float zf)
throws TrafficException
g - DOCUMENT ME!dx - DOCUMENT ME!dy - DOCUMENT ME!zf - DOCUMENT ME!
TrafficException - DOCUMENT ME!
public abstract void paint(java.awt.Graphics g,
int dx,
int dy,
float zf,
double angle)
throws TrafficException
g - DOCUMENT ME!dx - DOCUMENT ME!dy - DOCUMENT ME!zf - DOCUMENT ME!angle - DOCUMENT ME!
TrafficException - DOCUMENT ME!
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
XMLSerializable
load in interface XMLSerializablemyElement - 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 XMLSerializableXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public void setParentName(java.lang.String parentName)
setParentName in interface XMLSerializableparentName - DOCUMENT ME!
public void loadSecondStage(java.util.Dictionary dictionaries)
throws XMLInvalidInputException,
XMLTreeException
loadSecondStage in interface TwoStageLoaderdictionaries - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||