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

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

public class LongestQueueTLC
extends TLController

This controller will switch TrafficLights so that the Trafficlight with the longest queue of waiting Roadusers will get set to green.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController
TLController.TLCDialog, TLController.TLCSettings
 
Field Summary
protected 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
LongestQueueTLC(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 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, setInfrastructure, setParentName, showSettings, trackNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shortXMLName

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

See Also:
Constant Field Values
Constructor Detail

LongestQueueTLC

public LongestQueueTLC(Infrastructure i)
The constructor for TL controllers

Parameters:
i - model being used.
Method Detail

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!