org.jscience.architecture.traffic.algorithms.tlc
Class TLDecision

java.lang.Object
  extended by org.jscience.architecture.traffic.algorithms.tlc.TLDecision
All Implemented Interfaces:
TwoStageLoader, XMLSerializable

public class TLDecision
extends java.lang.Object
implements XMLSerializable, TwoStageLoader

This class holds a tuple of a TrafficLight and a float value to represent the reward (Q) for the TrafficLight to be kept. Note : TLControllers typically don't use the XMLSerializable interface of this class, because they can load it faster themselves.


Field Summary
protected  org.jscience.architecture.traffic.algorithms.tlc.TLDecision.TwoStageLoaderData loadData
          DOCUMENT ME!
protected  java.lang.String parentName
          DOCUMENT ME!
 
Constructor Summary
TLDecision()
          Empty constructor for loading
TLDecision(TrafficLight tl, float f)
          The constructor for TLDecision.
 
Method Summary
 float getGain()
          Returns the Q value.
 TrafficLight getTL()
          Returns the TrafficLight.
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 void loadSecondStage(java.util.Dictionary dictionaries)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setGain(float _g)
          DOCUMENT ME!
 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
 

Field Detail

loadData

protected org.jscience.architecture.traffic.algorithms.tlc.TLDecision.TwoStageLoaderData loadData
DOCUMENT ME!


parentName

protected java.lang.String parentName
DOCUMENT ME!

Constructor Detail

TLDecision

public TLDecision()
Empty constructor for loading


TLDecision

public TLDecision(TrafficLight tl,
                  float f)
The constructor for TLDecision.

Parameters:
tl - The Trafficlight. The reward value (Q value).
f - DOCUMENT ME!
Method Detail

getTL

public TrafficLight getTL()
Returns the TrafficLight.

Returns:
The TrafficLight.
See Also:
gld.infra.TrafficLight

getGain

public float getGain()
Returns the Q value.

Returns:
The qValue.

setGain

public void setGain(float _g)
DOCUMENT ME!

Parameters:
_g - DOCUMENT ME!

load

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

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!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

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

getXMLName

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

Specified by:
getXMLName in interface XMLSerializable
Returns:
DOCUMENT ME!

setParentName

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

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - 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!