|
|||||||||
| 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.GenNeuralTLC
public class GenNeuralTLC
DOCUMENT ME!
| Nested Class Summary | |
|---|---|
protected class |
GenNeuralTLC.GenNeuralIndividual
DOCUMENT ME! |
protected class |
GenNeuralTLC.GenNeuralPopulation
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 float |
CROSSOVER_CHANCE
A constant for the chance that genes cross over |
protected GenNeuralTLC.GenNeuralIndividual[] |
ind
the current GenNeural that is running |
protected Infrastructure |
infra
DOCUMENT ME! |
protected static float |
MUTATION_CHANCE
A constant for the chance that mutation occurs |
protected int |
num_move
counter for the number of roadusers that did move |
protected int |
num_nodes
the number of nodes in the current infrastructure |
protected int |
num_step
counter for the number of steps the simulation has ran yet |
protected static int |
NUM_STEPS
A constant for the number of steps an individual may run |
protected int |
num_wait
counter for how many roadusers had to wait a turn |
protected static int |
NUMBER_GENERATIONS
A constant for the number of generations |
protected static int |
NUMBER_INDIVIDUALS
A constant for the number of individuals |
protected GenNeuralTLC.GenNeuralPopulation |
pop
The Population of GenNeuralIndividuals |
protected java.util.Random |
random
The pseudo-random number generator for generating the chances that certain events will occur |
protected static java.lang.String |
shortXMLName
DOCUMENT ME! |
| Fields inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController |
|---|
num_tls, tld, trackNode |
| Constructor Summary | |
|---|---|
GenNeuralTLC(Infrastructure i)
Creates a new GenNeural 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 |
loadSecondStage(java.util.Dictionary dictionaries)
DOCUMENT ME! |
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, 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 |
|---|
protected static int NUM_STEPS
protected static float CROSSOVER_CHANCE
protected static float MUTATION_CHANCE
protected static int NUMBER_INDIVIDUALS
protected static int NUMBER_GENERATIONS
protected static final java.lang.String shortXMLName
protected int num_nodes
protected int num_step
protected int num_wait
protected int num_move
protected GenNeuralTLC.GenNeuralIndividual[] ind
protected GenNeuralTLC.GenNeuralPopulation pop
protected java.util.Random random
protected Infrastructure infra
protected InstantiationAssistant assistant
| Constructor Detail |
|---|
public GenNeuralTLC(Infrastructure i)
i - The infrastructure this algorithm will have to operate on| Method Detail |
|---|
public void setInfrastructure(Infrastructure i)
setInfrastructure in class TLControlleri - The new infrastructure for which the algorithm has to be set uppublic TLDecision[][] decideTLs()
decideTLs in class TLControllergld.algo.tlc.TLDecision
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 load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
load in interface XMLSerializableload in class TLControllermyElement - DOCUMENT ME!loader - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!
public XMLElement saveSelf()
throws XMLCannotSaveException
saveSelf in interface XMLSerializablesaveSelf in class TLControllerXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaveChilds in class TLControllersaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public java.lang.String getXMLName()
getXMLName in interface XMLSerializable
public void loadSecondStage(java.util.Dictionary dictionaries)
throws XMLInvalidInputException,
XMLTreeException
loadSecondStage in interface TwoStageLoaderloadSecondStage in class TLControllerdictionaries - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
public java.lang.Object createInstance(java.lang.Class request)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
createInstance in interface InstantiationAssistantrequest - 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 InstantiationAssistantrequest - DOCUMENT ME!
public void showSettings(Controller c)
showSettings in class TLControllerc - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||