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

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

public class ACGJ1
extends TLController
implements XMLSerializable, TwoStageLoader, InstantiationAssistant

This controller has been designed by the GLD-Algo group. This algorithm creates for every new cycle of iteration a genetic population and tries to find the optimal city-wide configuration. This algorithm prevents deadlocks and stimulates green waves. This algorithm prevents endless waiting of roadusers. The fitness function "calcfitness" is the most important function of this algorithm.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController
TLController.TLCDialog, TLController.TLCSettings
 
Field Summary
protected  InstantiationAssistant assistant
          DOCUMENT ME!
protected  Infrastructure infra
          DOCUMENT ME!
protected static int maxGeneration
          DOCUMENT ME!
protected static float mutationFactor
          DOCUMENT ME!
protected static int populationSize
          DOCUMENT ME!
static java.lang.String shortXMLName
          DOCUMENT ME!
 
Fields inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController
num_tls, tld, trackNode
 
Constructor Summary
ACGJ1(Infrastructure i)
          Creates a new ACGJ1 object.
 
Method Summary
 boolean canCreateInstance(java.lang.Class request)
          DOCUMENT ME!
 java.lang.Object createInstance(java.lang.Class request)
          DOCUMENT ME!
 TLDecision[][] decideTLs()
          Calculates how every traffic light should be switched
 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 setInfrastructure(Infrastructure i)
          DOCUMENT ME!
 void showSettings(Controller c)
          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, reset, setParentName, trackNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jscience.architecture.traffic.xml.XMLSerializable
setParentName
 

Field Detail

shortXMLName

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

See Also:
Constant Field Values

mutationFactor

protected static float mutationFactor
DOCUMENT ME!


populationSize

protected static int populationSize
DOCUMENT ME!


maxGeneration

protected static int maxGeneration
DOCUMENT ME!


infra

protected Infrastructure infra
DOCUMENT ME!


assistant

protected InstantiationAssistant assistant
DOCUMENT ME!

Constructor Detail

ACGJ1

public ACGJ1(Infrastructure i)
Creates a new ACGJ1 object.

Parameters:
i - DOCUMENT ME!
Method Detail

setInfrastructure

public void setInfrastructure(Infrastructure i)
DOCUMENT ME!

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

decideTLs

public TLDecision[][] decideTLs()
Calculates how every traffic light should be switched

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!

showSettings

public void showSettings(Controller c)
DOCUMENT ME!

Overrides:
showSettings in class TLController
Parameters:
c - DOCUMENT ME!

load

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

Specified by:
load in interface XMLSerializable
Overrides:
load in class TLController
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
Overrides:
saveSelf in class TLController
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
Overrides:
saveChilds in class TLController
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!

loadSecondStage

public void loadSecondStage(java.util.Dictionary dictionaries)
                     throws XMLInvalidInputException,
                            XMLTreeException
DOCUMENT ME!

Specified by:
loadSecondStage in interface TwoStageLoader
Overrides:
loadSecondStage in class TLController
Parameters:
dictionaries - DOCUMENT ME!
Throws:
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!

createInstance

public java.lang.Object createInstance(java.lang.Class request)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.InstantiationException,
                                       java.lang.IllegalAccessException
DOCUMENT ME!

Specified by:
createInstance in interface InstantiationAssistant
Parameters:
request - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ClassNotFoundException - DOCUMENT ME!
java.lang.InstantiationException - DOCUMENT ME!
java.lang.IllegalAccessException - DOCUMENT ME!

canCreateInstance

public boolean canCreateInstance(java.lang.Class request)
DOCUMENT ME!

Specified by:
canCreateInstance in interface InstantiationAssistant
Parameters:
request - DOCUMENT ME!
Returns:
DOCUMENT ME!