org.jscience.architecture.traffic.infrastructure
Class CustomRoaduser

java.lang.Object
  extended by org.jscience.architecture.traffic.infrastructure.Roaduser
      extended by org.jscience.architecture.traffic.infrastructure.CustomRoaduser
All Implemented Interfaces:
java.lang.Cloneable, Selectable, SelectionStarter, TwoStageLoader, XMLSerializable

public class CustomRoaduser
extends Roaduser

DOCUMENT ME!


Field Summary
protected  int driver
          DOCUMENT ME!
protected  int[] passengers
          DOCUMENT ME!
protected  int vehicle
          DOCUMENT ME!
 
Fields inherited from class org.jscience.architecture.traffic.infrastructure.Roaduser
color, cycleAsked, cycleMoved, delay, destNode, drivelaneStartTime, inQueueForSign, loadData, parentName, position, prevSign, prevWaitPos, prevWaitTl, prevWaitTlColor, startNode, voted, waitPos, waitTl, waitTlColor
 
Constructor Summary
CustomRoaduser()
          Empty constructor for loading
CustomRoaduser(Node start, Node dest, int pos)
          Creates a new CustomRoaduser object.
 
Method Summary
 java.lang.String getDescription()
          Returns the description of this custom.
 int getDriver()
          Returns the ID of the driver.
 java.lang.String getDriverName()
          Returns the name of the driver.
 int getLength()
          Returns the length of this custom.
 java.lang.String getName()
          Returns the name of this custom.
 int getNumPassengers()
          DOCUMENT ME!
 int[] getPassengers()
          Returns an array of passenger IDs.
 java.lang.String getPicture()
          Returns the picture of this custom.
 java.lang.String getSound()
          Returns the sound of this custom.
 int getSpeed()
          Returns the speed of this custom.
 int getType()
          Returns the roaduser type of this custom.
 int getVehicle()
          Returns the ID of the vehicle.
 java.lang.String getVehicleName()
          Returns the name of thevehicle.
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          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 dlangle)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setDriver(int d)
          Sets the ID of the driver.
 void setPassengers(int[] p)
          Sets the list of passengers.
 void setVehicle(int v)
          Sets the ID of the vehicle.
 
Methods inherited from class org.jscience.architecture.traffic.infrastructure.Roaduser
addDelay, clone, didMove, didVote, getBounds, getCenterPoint, getChildren, getColor, getComplexBounds, getCurrentWaitPos, getCurrentWaitTl, getCurrentWaitTlColor, getCycleAsked, getCycleMoved, getDelay, getDestNode, getDistance, getDrivelaneStartTime, getInQueueForSign, getPosition, getPrevSign, getPrevWaitPos, getPrevWaitTl, getPrevWaitTlColor, getSelectionPoint, getSelectionPoints, getStartNode, hasChildren, isSelectable, loadSecondStage, paint, paint, resetStats, setColor, setCycleAsked, setCycleMoved, setDelay, setDestNode, setDrivelaneStartTime, setInQueueForSign, setParentName, setPosition, setPrevSign, setStartNode, setVoted, setWaitPos
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vehicle

protected int vehicle
DOCUMENT ME!


driver

protected int driver
DOCUMENT ME!


passengers

protected int[] passengers
DOCUMENT ME!

Constructor Detail

CustomRoaduser

public CustomRoaduser(Node start,
                      Node dest,
                      int pos)
Creates a new CustomRoaduser object.

Parameters:
start - DOCUMENT ME!
dest - DOCUMENT ME!
pos - DOCUMENT ME!

CustomRoaduser

public CustomRoaduser()
Empty constructor for loading

Method Detail

getVehicle

public int getVehicle()
Returns the ID of the vehicle.

Returns:
DOCUMENT ME!

getVehicleName

public java.lang.String getVehicleName()
Returns the name of thevehicle.

Overrides:
getVehicleName in class Roaduser
Returns:
DOCUMENT ME!

setVehicle

public void setVehicle(int v)
Sets the ID of the vehicle.

Parameters:
v - DOCUMENT ME!

getDriver

public int getDriver()
Returns the ID of the driver.

Returns:
DOCUMENT ME!

getDriverName

public java.lang.String getDriverName()
Returns the name of the driver.

Overrides:
getDriverName in class Roaduser
Returns:
DOCUMENT ME!

setDriver

public void setDriver(int d)
Sets the ID of the driver.

Parameters:
d - DOCUMENT ME!

getPassengers

public int[] getPassengers()
Returns an array of passenger IDs.

Returns:
DOCUMENT ME!

getNumPassengers

public int getNumPassengers()
DOCUMENT ME!

Specified by:
getNumPassengers in class Roaduser
Returns:
DOCUMENT ME!

setPassengers

public void setPassengers(int[] p)
Sets the list of passengers.

Parameters:
p - DOCUMENT ME!

getSpeed

public int getSpeed()
Returns the speed of this custom.

Specified by:
getSpeed in class Roaduser
Returns:
DOCUMENT ME!

getLength

public int getLength()
Returns the length of this custom.

Specified by:
getLength in class Roaduser
Returns:
DOCUMENT ME!

getType

public int getType()
Returns the roaduser type of this custom.

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

getName

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

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

getDescription

public java.lang.String getDescription()
Returns the description of this custom.

Overrides:
getDescription in class Roaduser
Returns:
DOCUMENT ME!

getPicture

public java.lang.String getPicture()
Returns the picture of this custom.

Overrides:
getPicture in class Roaduser
Returns:
DOCUMENT ME!

getSound

public java.lang.String getSound()
Returns the sound of this custom.

Overrides:
getSound in class Roaduser
Returns:
DOCUMENT ME!

paint

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

Specified by:
paint in class Roaduser
Parameters:
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
zf - DOCUMENT ME!

paint

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

Specified by:
paint in class Roaduser
Parameters:
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
zf - DOCUMENT ME!
dlangle - DOCUMENT ME!

getXMLName

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

Returns:
DOCUMENT ME!

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
DOCUMENT ME!

Specified by:
load in interface XMLSerializable
Overrides:
load in class Roaduser
Parameters:
myElement - DOCUMENT ME!
loader - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Overrides:
saveSelf in class Roaduser
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 Roaduser
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!