org.jscience.architecture.traffic.algorithms.tlc
Class ACGJ5.Individual

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

protected class ACGJ5.Individual
extends java.lang.Object
implements XMLSerializable

DOCUMENT ME!


Field Summary
protected  float fitness
          DOCUMENT ME!
protected  float[] genes
          DOCUMENT ME!
protected  float[][] me
          DOCUMENT ME!
protected  int move
          DOCUMENT ME!
protected  java.lang.String myParentName
          DOCUMENT ME!
protected  int wait
          DOCUMENT ME!
 
Constructor Summary
protected ACGJ5.Individual()
          Constructor for loading
protected ACGJ5.Individual(float[] _genes)
          Creates a new Individual, providing the reproduction genes from daddy and mummy
protected ACGJ5.Individual(Infrastructure infra)
          Creates a new Individual, providing the Infrastructure it should run on
 
Method Summary
protected  void createMe()
          DOCUMENT ME!
protected  float getFactor(int node, int tl)
          Calculates the gain-factor for the given TrafficLight
protected  float getFitness()
           
protected  float[] getGenes()
          Returns the genes of this Individual
protected  int getMove()
           
protected  int getWait()
           
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
protected  void reset()
          Resets the buckets and waiting values for this Individual
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
protected  void setFitness(float fit)
           
protected  void setMove(int _move)
           
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
protected  void setWait(int _wait)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

genes

protected float[] genes
DOCUMENT ME!


me

protected float[][] me
DOCUMENT ME!


fitness

protected float fitness
DOCUMENT ME!


wait

protected int wait
DOCUMENT ME!


move

protected int move
DOCUMENT ME!


myParentName

protected java.lang.String myParentName
DOCUMENT ME!

Constructor Detail

ACGJ5.Individual

protected ACGJ5.Individual(Infrastructure infra)
Creates a new Individual, providing the Infrastructure it should run on

Parameters:
infra - DOCUMENT ME!

ACGJ5.Individual

protected ACGJ5.Individual(float[] _genes)
Creates a new Individual, providing the reproduction genes from daddy and mummy

Parameters:
_genes - DOCUMENT ME!

ACGJ5.Individual

protected ACGJ5.Individual()
Constructor for loading

Method Detail

createMe

protected void createMe()
DOCUMENT ME!


reset

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


getGenes

protected float[] getGenes()
Returns the genes of this Individual

Returns:
DOCUMENT ME!

getFitness

protected float getFitness()

setFitness

protected void setFitness(float fit)

setWait

protected void setWait(int _wait)

getWait

protected int getWait()

setMove

protected void setMove(int _move)

getMove

protected int getMove()

getFactor

protected float getFactor(int node,
                          int tl)
Calculates the gain-factor for 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 factor that should be used to calculate the real gain-value

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!