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

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

public class SignController
extends java.lang.Object
implements XMLSerializable

This is the class for the sign controller. Here is decided how each sign should work. Reward values are gathered for each sign, when set on 'Green' asking the applied TLController. Non-TrafficLight signs can also be implemented when a Q-value algorithm is implemented for the appropiate type of sign. After those values are gathered, this class will select the most rewarding trafficlightconfiguration for each Node and will set the Signs accordingly.

See Also:
gld.infra.Sign

Field Summary
static boolean CrossNodesSafely
          Indicates if trafficlights must be switched safely or not.
protected  Sign[][] currentSC
          DOCUMENT ME!
protected  Infrastructure infra
          DOCUMENT ME!
protected  int num_nodes
          DOCUMENT ME!
protected static java.lang.String shortXMLName
          DOCUMENT ME!
protected  TLController tlcontroller
          The TLcontroller is used to gather Q-values and use them to set all the TLs
 
Constructor Summary
SignController(TLController t, Infrastructure i)
          Creates a new SignController object.
 
Method Summary
protected  Sign[] calcOverlap(Sign[] ar1, Sign[] ar2)
          DOCUMENT ME!
 Infrastructure getInfrastructure()
          DOCUMENT ME!
 TLController getTLC()
          DOCUMENT ME!
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setInfrastructure(Infrastructure i)
          DOCUMENT ME!
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 void setTLC(TLController t)
          DOCUMENT ME!
 void switchSigns()
          Switch all the signs to their appropiate value.
 void switchTrafficLights(Junction node, TLDecision[] dec)
          Switch the the TLsigns to their appropiate value The configuration with highest total gain is chosen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CrossNodesSafely

public static boolean CrossNodesSafely
Indicates if trafficlights must be switched safely or not. Safely means no 2 trafficlights may be turned to green at the same time, if roadusers moving from the drivelanes behind those signs would collide on the node.


shortXMLName

protected static final java.lang.String shortXMLName
DOCUMENT ME!

See Also:
Constant Field Values

tlcontroller

protected TLController tlcontroller
The TLcontroller is used to gather Q-values and use them to set all the TLs


infra

protected Infrastructure infra
DOCUMENT ME!


num_nodes

protected int num_nodes
DOCUMENT ME!


currentSC

protected Sign[][] currentSC
DOCUMENT ME!

Constructor Detail

SignController

public SignController(TLController t,
                      Infrastructure i)
Creates a new SignController object.

Parameters:
t - DOCUMENT ME!
i - DOCUMENT ME!
Method Detail

getInfrastructure

public Infrastructure getInfrastructure()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setInfrastructure

public void setInfrastructure(Infrastructure i)
DOCUMENT ME!

Parameters:
i - DOCUMENT ME!

getTLC

public TLController getTLC()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setTLC

public void setTLC(TLController t)
DOCUMENT ME!

Parameters:
t - DOCUMENT ME!

switchSigns

public void switchSigns()
Switch all the signs to their appropiate value.


switchTrafficLights

public void switchTrafficLights(Junction node,
                                TLDecision[] dec)
Switch the the TLsigns to their appropiate value The configuration with highest total gain is chosen

Parameters:
node - DOCUMENT ME!
dec - The decision array consists of the generated values.

calcOverlap

protected Sign[] calcOverlap(Sign[] ar1,
                             Sign[] ar2)
DOCUMENT ME!

Parameters:
ar1 - DOCUMENT ME!
ar2 - 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
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)
                   throws XMLTreeException
DOCUMENT ME!

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