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

java.lang.Object
  extended by org.jscience.architecture.traffic.algorithms.dp.DrivingPolicy
All Implemented Interfaces:
TwoStageLoader, XMLSerializable
Direct Known Subclasses:
AggressiveDP, ColearnPolicy, ShortestPathDP, SmarterShortestPathDP

public abstract class DrivingPolicy
extends java.lang.Object
implements XMLSerializable, TwoStageLoader

This is the abstract class for each driving policy.


Field Summary
protected  SimModel model
          DOCUMENT ME!
protected  TLController tlc
          DOCUMENT ME!
 
Method Summary
 Drivelane getDirection(Roaduser r, Drivelane lane_now, Node node_now)
          The lane to which a car continues his trip.
abstract  Drivelane getDirectionLane(Roaduser r, Drivelane lane_now, Drivelane[] allOutgoing, Drivelane[] shortest)
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          Empty for Drivingpolicy
 void loadSecondStage(java.util.Dictionary dictionaries)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          Empty for Drivingpolicy
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 
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
getXMLName, saveSelf
 

Field Detail

model

protected SimModel model
DOCUMENT ME!


tlc

protected TLController tlc
DOCUMENT ME!

Method Detail

getDirection

public Drivelane getDirection(Roaduser r,
                              Drivelane lane_now,
                              Node node_now)
                       throws InfraException
The lane to which a car continues his trip.

Parameters:
r - The road user being asked.
lane_now - All the possible outgoing lanes
node_now - All the lanes which are in a shortest path to the car's destination
Returns:
The chosen lane.
Throws:
InfraException - DOCUMENT ME!

getDirectionLane

public abstract Drivelane getDirectionLane(Roaduser r,
                                           Drivelane lane_now,
                                           Drivelane[] allOutgoing,
                                           Drivelane[] shortest)
DOCUMENT ME!

Parameters:
r - DOCUMENT ME!
lane_now - DOCUMENT ME!
allOutgoing - DOCUMENT ME!
shortest - DOCUMENT ME!
Returns:
DOCUMENT ME!

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
Empty for Drivingpolicy

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

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
Empty for Drivingpolicy

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

setParentName

public void setParentName(java.lang.String parentName)
                   throws XMLTreeException
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!

loadSecondStage

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

Specified by:
loadSecondStage in interface TwoStageLoader
Parameters:
dictionaries - DOCUMENT ME!
Throws:
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!