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

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

public class BestFirstTLC
extends TLController

This controller will switch TrafficLights so that a SignConfig is selected where in total the most Roadusers are waiting.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController
TLController.TLCDialog, TLController.TLCSettings
 
Field Summary
protected  int num_nodes
          DOCUMENT ME!
static java.lang.String shortXMLName
          DOCUMENT ME!
 
Fields inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController
infra, num_tls, tld, trackNode
 
Constructor Summary
BestFirstTLC(Infrastructure i)
          The constructor for TL controllers
 
Method Summary
 TLDecision[][] decideTLs()
          This implementation sets the Q-values according to the length of the waiting queue.
 java.lang.String getXMLName()
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setInfrastructure(Infrastructure i)
          DOCUMENT ME!
 void updateRoaduserMove(Roaduser _ru, Drivelane _prevlane, Sign _prevsign, int _prevpos, Drivelane _dlanenow, Sign _signnow, int _posnow, PosMov[] posMovs, Drivelane desired)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController
applyGainValues, createDecisionArray, doSettingsDialog, getGainValuesFromDecisionArray, getInfrastructure, getNumTLs, load, loadSecondStage, reset, saveChilds, setParentName, showSettings, trackNode
 
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
DOCUMENT ME!

See Also:
Constant Field Values

num_nodes

protected int num_nodes
DOCUMENT ME!

Constructor Detail

BestFirstTLC

public BestFirstTLC(Infrastructure i)
The constructor for TL controllers

Parameters:
i - model being used.
Method Detail

setInfrastructure

public void setInfrastructure(Infrastructure i)
DOCUMENT ME!

Overrides:
setInfrastructure in class TLController
Parameters:
i - DOCUMENT ME!

decideTLs

public TLDecision[][] decideTLs()
This implementation sets the Q-values according to the length of the waiting queue. The longer the queue, the higher the Q-value.

Specified by:
decideTLs in class TLController
Returns:
DOCUMENT ME!
See Also:
gld.algo.tlc.TLDecision

updateRoaduserMove

public void updateRoaduserMove(Roaduser _ru,
                               Drivelane _prevlane,
                               Sign _prevsign,
                               int _prevpos,
                               Drivelane _dlanenow,
                               Sign _signnow,
                               int _posnow,
                               PosMov[] posMovs,
                               Drivelane desired)
DOCUMENT ME!

Specified by:
updateRoaduserMove in class TLController
Parameters:
_ru - DOCUMENT ME!
_prevlane - DOCUMENT ME!
_prevsign - DOCUMENT ME!
_prevpos - DOCUMENT ME!
_dlanenow - DOCUMENT ME!
_signnow - DOCUMENT ME!
_posnow - DOCUMENT ME!
posMovs - DOCUMENT ME!
desired - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Overrides:
saveSelf in class TLController
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

getXMLName

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

Returns:
DOCUMENT ME!