org.jscience.architecture.traffic.algorithms.dp
Class ShortestPathDP

java.lang.Object
  extended by org.jscience.architecture.traffic.algorithms.dp.DrivingPolicy
      extended by org.jscience.architecture.traffic.algorithms.dp.ShortestPathDP
All Implemented Interfaces:
TwoStageLoader, XMLSerializable

public class ShortestPathDP
extends DrivingPolicy

This extension of gld.DrivingPolicy selects the next lane by finding one which on the shortest path to road user's destination.


Field Summary
static java.lang.String shortXMLName
           
 
Fields inherited from class org.jscience.architecture.traffic.algorithms.dp.DrivingPolicy
model, tlc
 
Constructor Summary
ShortestPathDP(SimModel sim, TLController _tlc)
          The constructor for a shortest driving policy.
 
Method Summary
 Drivelane getDirectionLane(Roaduser r, Drivelane lane_now, Drivelane[] allOutgoing, Drivelane[] shortest)
          The lane to which a car continues his trip.
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          Empty for Drivingpolicy
 XMLElement saveSelf()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.architecture.traffic.algorithms.dp.DrivingPolicy
getDirection, loadSecondStage, saveChilds, setParentName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shortXMLName

public static final java.lang.String shortXMLName
See Also:
Constant Field Values
Constructor Detail

ShortestPathDP

public ShortestPathDP(SimModel sim,
                      TLController _tlc)
The constructor for a shortest driving policy.

Parameters:
m - The model which is used
Method Detail

getDirectionLane

public Drivelane getDirectionLane(Roaduser r,
                                  Drivelane lane_now,
                                  Drivelane[] allOutgoing,
                                  Drivelane[] shortest)
The lane to which a car continues his trip.

Specified by:
getDirectionLane in class DrivingPolicy
Parameters:
r - The road user being asked.
allOutgoing - All the possible outgoing lanes
shortest - All the lanes which are in a shortest path to the car's destination
lane_now - DOCUMENT ME!
Returns:
The chosen lane.

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
Description copied from class: DrivingPolicy
Empty for Drivingpolicy

Specified by:
load in interface XMLSerializable
Overrides:
load in class DrivingPolicy
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
Description copied from interface: XMLSerializable
DOCUMENT ME!

Returns:
The XMLElement which represents the internal datastate. This function is not meant to save child objects. That is done in void saveChilds()
Throws:
XMLCannotSaveException - The XMLSerializable can throw this exception if it cannot save itself or one of its child objects for whatever reason.

getXMLName

public java.lang.String getXMLName()
Description copied from interface: XMLSerializable
DOCUMENT ME!

Returns:
The tagname of the XML element in which information about this object is stored prepended by a dot separated list of the tagnames of the parents of this object. (e.g. "model.infrastructure.node")