org.jscience.architecture.traffic.algorithms.tlc
Class ACGJ3FixedValue.ACGJ3FixedValueIndividual

java.lang.Object
  extended by org.jscience.architecture.traffic.algorithms.tlc.ACGJ3FixedValue.ACGJ3FixedValueIndividual
All Implemented Interfaces:
XMLSerializable
Enclosing class:
ACGJ3FixedValue

protected class ACGJ3FixedValue.ACGJ3FixedValueIndividual
extends java.lang.Object
implements XMLSerializable

DOCUMENT ME!


Field Summary
protected  float[][][] me
          The array of float values that describe this ACGJ3Individual.
protected  java.lang.String myParentName
          DOCUMENT ME!
 
Constructor Summary
protected ACGJ3FixedValue.ACGJ3FixedValueIndividual(Infrastructure infra)
          Creates a new ACGJ3Individual, providing the Infrastructure it should run on
 
Method Summary
protected  void createMe()
          DOCUMENT ME!
protected  float getQValue(int node, int tl)
          Calculates the current gain of the given TrafficLight
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
protected  void relaxBucket(int node, TrafficLight tl)
          Empties the 'gain-value' bucket partly, which is being filled when Roadusers are waiting/voting for their TrafficLight to be set to green.
protected  void reset()
          Resets the buckets and waiting values for this Individual
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
protected  void siphonToOtherBucket(TrafficLight here, TrafficLight there)
          When a Roaduser may drive according to it's Sign, but cant as the desired Drivelane is full, (some/all) of the current gain-bucket of it's current TrafficLight is siphoned over to the desired Drivelane, making it more probable that that lane will move, making it possible for this Drivelane to move.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

me

protected float[][][] me
The array of float values that describe this ACGJ3Individual. Hence the name of the array. Encoded are for every TrafficLight in the Infrastructure: a float value 'weight per waiting roaduser' a float value 'degrading/increasement weight per Roaduser waiting further up the Queue' a float value 'gain-bucket' in which all the weights of waiting Roadusers are collected a float value 'number of Roadusers waiting' which is needed to make decreasement of the gain-bucket possible


myParentName

protected java.lang.String myParentName
DOCUMENT ME!

Constructor Detail

ACGJ3FixedValue.ACGJ3FixedValueIndividual

protected ACGJ3FixedValue.ACGJ3FixedValueIndividual(Infrastructure infra)
Creates a new ACGJ3Individual, providing the Infrastructure it should run on

Parameters:
infra - DOCUMENT ME!
Method Detail

createMe

protected void createMe()
DOCUMENT ME!


reset

protected void reset()
Resets the buckets and waiting values for this Individual


getQValue

protected float getQValue(int node,
                          int tl)
Calculates the current gain of the given TrafficLight

Parameters:
node - the Id of the Node this TrafficLight belongs to
tl - The position of the TrafficLight in the TLDecision[][]
Returns:
the gain-value of when this TrafficLight is set to green

relaxBucket

protected void relaxBucket(int node,
                           TrafficLight tl)
Empties the 'gain-value' bucket partly, which is being filled when Roadusers are waiting/voting for their TrafficLight to be set to green.

Parameters:
node - The Id of the Node of which a bucket has to be emptied a bit
tl - The TrafficLight of which a bucket has to be partly emptied in the TLDecision[][]

siphonToOtherBucket

protected void siphonToOtherBucket(TrafficLight here,
                                   TrafficLight there)
When a Roaduser may drive according to it's Sign, but cant as the desired Drivelane is full, (some/all) of the current gain-bucket of it's current TrafficLight is siphoned over to the desired Drivelane, making it more probable that that lane will move, making it possible for this Drivelane to move.

Parameters:
here - the Id of the Node at which the Roaduser is waiting
there - The TrafficLight the Roaduser is waiting for

load

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

Specified by:
load in interface XMLSerializable
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
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
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!

setParentName

public void setParentName(java.lang.String parentName)
                   throws XMLTreeException
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!