|
|||||||||
| 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.TC3Opt
public class TC3Opt
This algorithm works like TC1 with extra functionality. It outcome is adjusted by reinforcement learning. The Q values are created overseeing the whole environment of each traffic light.
gld.algo.tlc.TC1TLC| Nested Class Summary | |
|---|---|
class |
TC3Opt.CountEntry
|
class |
TC3Opt.PEntry
DOCUMENT ME! |
class |
TC3Opt.PKtlEntry
DOCUMENT ME! |
protected class |
TC3Opt.Target
DOCUMENT ME! |
| Nested classes/interfaces inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController |
|---|
TLController.TLCDialog, TLController.TLCSettings |
| Field Summary | |
|---|---|
protected Node[] |
allnodes
DOCUMENT ME! |
protected java.util.Vector[][][] |
count
DOCUMENT ME! |
protected float |
gamma
DOCUMENT ME! |
protected static boolean |
green
DOCUMENT ME! |
protected static int |
green_index
DOCUMENT ME! |
protected Infrastructure |
infrastructure
DOCUMENT ME! |
protected int |
num_nodes
DOCUMENT ME! |
protected java.util.Vector[][][] |
p_table
DOCUMENT ME! |
protected java.util.Vector[][][] |
pKtl_table
DOCUMENT ME! |
protected float[][][][] |
q_table
DOCUMENT ME! |
protected float[][][][] |
qa_table
DOCUMENT ME! |
protected static float |
random_chance
DOCUMENT ME! |
protected static boolean |
red
DOCUMENT ME! |
protected static int |
red_index
DOCUMENT ME! |
static java.lang.String |
shortXMLName
DOCUMENT ME! |
protected TrafficLight[][] |
tls
DOCUMENT ME! |
protected float[][][] |
v_table
DOCUMENT ME! |
protected float[][][] |
va_table
DOCUMENT ME! |
| Fields inherited from class org.jscience.architecture.traffic.algorithms.tlc.TLController |
|---|
infra, num_tls, tld, trackNode |
| Constructor Summary | |
|---|---|
TC3Opt(Infrastructure infra)
The constructor for TL controllers |
|
| Method Summary | |
|---|---|
boolean |
canCreateInstance(java.lang.Class request)
DOCUMENT ME! |
protected int[] |
count(Sign tl,
int pos,
Node destination)
|
java.lang.Object |
createInstance(java.lang.Class request)
DOCUMENT ME! |
TLDecision[][] |
decideTLs()
Calculates how every traffic light should be switched Per node, per sign the waiting roadusers are passed and per each roaduser the gain is calculated. |
float |
getColearnValue(Sign sign_new,
Sign sign,
Node destination,
int pos)
DOCUMENT ME! |
float |
getVValue(Sign sign,
Node des,
int pos)
DOCUMENT ME! |
java.lang.String |
getXMLName()
DOCUMENT ME! |
void |
load(XMLElement myElement,
XMLLoader loader)
DOCUMENT ME! |
void |
loadSecondStage(java.util.Dictionary dictionaries)
DOCUMENT ME! |
protected void |
recalcP(Sign tl,
int pos,
Node destination,
boolean light,
Sign tl_new,
int pos_new,
int Ktl)
DOCUMENT ME! |
protected void |
recalcQ(Sign tl,
int pos,
Node destination,
boolean light,
Sign tl_new,
int pos_new,
PosMov[] posMovs,
int Ktl)
DOCUMENT ME! |
protected void |
recalcQa(Sign tl,
int pos,
Node destination,
boolean light,
Sign tl_new,
int pos_new,
PosMov[] posMovs)
DOCUMENT ME! |
protected void |
recalcV(Sign tl,
int pos,
Node destination,
boolean light,
int Ktl)
DOCUMENT ME! |
protected void |
recalcVa(Sign tl,
int pos,
Node destination)
DOCUMENT ME! |
protected int |
rewardFunction(Sign tl_new,
int pos_new,
PosMov[] posMovs)
DOCUMENT ME! |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setInfrastructure(Infrastructure infra)
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 |
| Field Detail |
|---|
protected static final boolean red
protected static final boolean green
protected static final int green_index
protected static final int red_index
public static final java.lang.String shortXMLName
protected static float random_chance
protected Infrastructure infrastructure
protected TrafficLight[][] tls
protected Node[] allnodes
protected int num_nodes
protected java.util.Vector[][][] count
protected java.util.Vector[][][] p_table
protected java.util.Vector[][][] pKtl_table
protected float[][][][] q_table
protected float[][][][] qa_table
protected float[][][] v_table
protected float[][][] va_table
protected float gamma
| Constructor Detail |
|---|
public TC3Opt(Infrastructure infra)
throws InfraException
infra - model being used.
InfraException - DOCUMENT ME!| Method Detail |
|---|
public void setInfrastructure(Infrastructure infra)
setInfrastructure in class TLControllerinfra - DOCUMENT ME!public 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 TLControllerru - 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!
protected void recalcP(Sign tl,
int pos,
Node destination,
boolean light,
Sign tl_new,
int pos_new,
int Ktl)
tl - DOCUMENT ME!pos - DOCUMENT ME!destination - DOCUMENT ME!light - DOCUMENT ME!tl_new - DOCUMENT ME!pos_new - DOCUMENT ME!Ktl - DOCUMENT ME!
protected void recalcQ(Sign tl,
int pos,
Node destination,
boolean light,
Sign tl_new,
int pos_new,
PosMov[] posMovs,
int Ktl)
tl - DOCUMENT ME!pos - DOCUMENT ME!destination - DOCUMENT ME!light - DOCUMENT ME!tl_new - DOCUMENT ME!pos_new - DOCUMENT ME!posMovs - DOCUMENT ME!Ktl - DOCUMENT ME!
protected void recalcV(Sign tl,
int pos,
Node destination,
boolean light,
int Ktl)
tl - DOCUMENT ME!pos - DOCUMENT ME!destination - DOCUMENT ME!light - DOCUMENT ME!Ktl - DOCUMENT ME!
protected void recalcVa(Sign tl,
int pos,
Node destination)
tl - DOCUMENT ME!pos - DOCUMENT ME!destination - DOCUMENT ME!
protected void recalcQa(Sign tl,
int pos,
Node destination,
boolean light,
Sign tl_new,
int pos_new,
PosMov[] posMovs)
tl - DOCUMENT ME!pos - DOCUMENT ME!destination - DOCUMENT ME!light - DOCUMENT ME!tl_new - DOCUMENT ME!pos_new - DOCUMENT ME!posMovs - DOCUMENT ME!
protected int[] count(Sign tl,
int pos,
Node destination)
protected int rewardFunction(Sign tl_new,
int pos_new,
PosMov[] posMovs)
tl_new - DOCUMENT ME!pos_new - DOCUMENT ME!posMovs - DOCUMENT ME!
public float getVValue(Sign sign,
Node des,
int pos)
sign - DOCUMENT ME!des - DOCUMENT ME!pos - DOCUMENT ME!
public float getColearnValue(Sign sign_new,
Sign sign,
Node destination,
int pos)
getColearnValue in interface Colearningsign_new - DOCUMENT ME!sign - DOCUMENT ME!destination - DOCUMENT ME!pos - DOCUMENT ME!
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 boolean canCreateInstance(java.lang.Class request)
canCreateInstance in interface InstantiationAssistantrequest - 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 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 | ||||||||