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

java.lang.Object
  extended by org.jscience.architecture.traffic.algorithms.dp.DPFactory

public class DPFactory
extends java.lang.Object

DOCUMENT ME!


Field Summary
static int AGGRESSIVE
          DOCUMENT ME!
static int COLEARNING
          DOCUMENT ME!
protected static java.lang.String[] dpDescs
          DOCUMENT ME!
protected  SimModel model
          DOCUMENT ME!
static int SHORTEST_PATH
          DOCUMENT ME!
static int SMARTER_SHORTEST_PATH
          DOCUMENT ME!
protected  TLController tlc
          DOCUMENT ME!
protected static java.lang.String[] xmlNames
          DOCUMENT ME!
 
Constructor Summary
DPFactory(SimModel model, TLController tlc)
          Makes a new DPFactory for a specific SimModel and TLC
 
Method Summary
 DrivingPolicy genDP(int dp)
          Returns a new DrivingPolicy of the requested ID
static java.lang.String getDescription(int algoId)
          Look up the description of a DP algorithm by its id
static java.lang.String[] getDescriptions()
          Returns an array of driving policy descriptions
static int getId(java.lang.String algoDesc)
          Looks up the id of a DP algorithm by its description
 DrivingPolicy getInstance(int algoId)
          Gets a new instance of an algorithm by its number.
static int getNumberByXMLTagName(java.lang.String tagName)
          Gets the number of an algorithm from its XML tag name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORTEST_PATH

public static final int SHORTEST_PATH
DOCUMENT ME!

See Also:
Constant Field Values

SMARTER_SHORTEST_PATH

public static final int SMARTER_SHORTEST_PATH
DOCUMENT ME!

See Also:
Constant Field Values

AGGRESSIVE

public static final int AGGRESSIVE
DOCUMENT ME!

See Also:
Constant Field Values

COLEARNING

public static final int COLEARNING
DOCUMENT ME!

See Also:
Constant Field Values

dpDescs

protected static final java.lang.String[] dpDescs
DOCUMENT ME!


xmlNames

protected static final java.lang.String[] xmlNames
DOCUMENT ME!


model

protected SimModel model
DOCUMENT ME!


tlc

protected TLController tlc
DOCUMENT ME!

Constructor Detail

DPFactory

public DPFactory(SimModel model,
                 TLController tlc)
Makes a new DPFactory for a specific SimModel and TLC

Parameters:
model - The SimModel to create the algorithm for
tlc - The traffic light controller to co-operate with
Method Detail

getId

public static int getId(java.lang.String algoDesc)
Looks up the id of a DP algorithm by its description

Parameters:
algoDesc - The description of the algorithm
Returns:
The id of the algorithm

getDescriptions

public static java.lang.String[] getDescriptions()
Returns an array of driving policy descriptions

Returns:
DOCUMENT ME!

genDP

public DrivingPolicy genDP(int dp)
                    throws java.lang.ClassNotFoundException
Returns a new DrivingPolicy of the requested ID

Parameters:
dp - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ClassNotFoundException - DOCUMENT ME!

getDescription

public static java.lang.String getDescription(int algoId)
Look up the description of a DP algorithm by its id

Parameters:
algoId - The id of the algorithm
Returns:
The description

getNumberByXMLTagName

public static int getNumberByXMLTagName(java.lang.String tagName)
Gets the number of an algorithm from its XML tag name

Parameters:
tagName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getInstance

public DrivingPolicy getInstance(int algoId)
                          throws java.lang.ClassNotFoundException
Gets a new instance of an algorithm by its number. This method is meant to be used for loading.

Parameters:
algoId - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ClassNotFoundException - DOCUMENT ME!