|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jscience.architecture.traffic.algorithms.tlc.TLController
org.jscience.architecture.traffic.algorithms.tlc.ACGJ3FixedValue
public class ACGJ3FixedValue
Now with extra improved but still sometimes not too great performance!
Nested Class Summary | |
---|---|
protected class |
ACGJ3FixedValue.ACGJ3FixedValueIndividual
DOCUMENT ME! |
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 static int |
BUCK
Used constants for array addressing |
protected static int |
DECF
Used constants for array addressing |
protected static float |
DECREASE
Constants used for calculating gains |
protected ACGJ3FixedValue.ACGJ3FixedValueIndividual |
ind
the current ACGJ3Individual that is running |
protected Infrastructure |
infra
The infrastructure which this algorithm runs on |
protected int |
num_nodes
counter for the number of roadusers that did move |
protected java.util.Random |
random
The pseudo-random number generator for generating the chances that certain events will occur |
protected static float |
RUWAIT
Constants used for calculating gains |
protected static int |
RUWF
Used constants for array addressing |
protected static java.lang.String |
shortXMLName
DOCUMENT ME! |
protected static int |
WAIT
Used constants for array addressing |
Fields inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController |
---|
num_tls, tld, trackNode |
Constructor Summary | |
---|---|
ACGJ3FixedValue(Infrastructure _i)
Creates a new ACGJ3 Algorithm. |
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 |
reset()
Resets the algorithm |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setInfrastructure(Infrastructure _i)
Changes the Infrastructure this algorithm is working on |
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)
Provides the TLC-algorithm with information about a roaduser that has had it's go in the moveAllRoaduser-cycle. |
Methods inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController |
---|
applyGainValues, createDecisionArray, doSettingsDialog, getGainValuesFromDecisionArray, getInfrastructure, getNumTLs, loadSecondStage, 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 |
---|
protected static float DECREASE
protected static float RUWAIT
protected static final int BUCK
protected static final int WAIT
protected static final int DECF
protected static final int RUWF
protected static final java.lang.String shortXMLName
protected int num_nodes
protected ACGJ3FixedValue.ACGJ3FixedValueIndividual ind
protected java.util.Random random
protected Infrastructure infra
protected InstantiationAssistant assistant
Constructor Detail |
---|
public ACGJ3FixedValue(Infrastructure _i)
_i
- The infrastructure this algorithm will have to operate onMethod Detail |
---|
public void setInfrastructure(Infrastructure _i)
setInfrastructure
in class TLController
_i
- The new infrastructure for which the algorithm has to be set
uppublic TLDecision[][] decideTLs()
decideTLs
in class TLController
gld.algo.tlc.TLDecision
public void reset()
reset
in class TLController
public void updateRoaduserMove(Roaduser _ru, Drivelane _prevlane, Sign _prevsign, int _prevpos, Drivelane _dlanenow, Sign _signnow, int _posnow, PosMov[] posMovs, Drivelane _desired)
updateRoaduserMove
in class TLController
_ru
- _prevlane
- _prevsign
- _prevpos
- _dlanenow
- _signnow
- _posnow
- posMovs
- _desired
- public void showSettings(Controller c)
showSettings
in class TLController
c
- DOCUMENT ME!public void load(XMLElement myElement, XMLLoader loader) throws XMLTreeException, java.io.IOException, XMLInvalidInputException
load
in interface XMLSerializable
load
in class TLController
myElement
- DOCUMENT ME!loader
- DOCUMENT ME!
XMLTreeException
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!
XMLInvalidInputException
- DOCUMENT ME!public XMLElement saveSelf() throws XMLCannotSaveException
saveSelf
in interface XMLSerializable
saveSelf
in class TLController
XMLCannotSaveException
- DOCUMENT ME!public void saveChilds(XMLSaver saver) throws XMLTreeException, java.io.IOException, XMLCannotSaveException
saveChilds
in interface XMLSerializable
saveChilds
in class TLController
saver
- DOCUMENT ME!
XMLTreeException
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!
XMLCannotSaveException
- DOCUMENT ME!public java.lang.String getXMLName()
getXMLName
in interface XMLSerializable
public java.lang.Object createInstance(java.lang.Class request) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
createInstance
in interface InstantiationAssistant
request
- DOCUMENT ME!
java.lang.ClassNotFoundException
- DOCUMENT ME!
java.lang.InstantiationException
- DOCUMENT ME!
java.lang.IllegalAccessException
- DOCUMENT ME!public boolean canCreateInstance(java.lang.Class request)
canCreateInstance
in interface InstantiationAssistant
request
- DOCUMENT ME!
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |