org.jscience.architecture.traffic.algorithms.tlc
Class GenNeuralTLC.GenNeuralPopulation

java.lang.Object
  extended by org.jscience.architecture.traffic.algorithms.tlc.GenNeuralTLC.GenNeuralPopulation
All Implemented Interfaces:
TwoStageLoader, XMLSerializable
Enclosing class:
GenNeuralTLC

protected class GenNeuralTLC.GenNeuralPopulation
extends java.lang.Object
implements XMLSerializable, TwoStageLoader

DOCUMENT ME!


Field Summary
protected  GenNeuralTLC.GenNeuralIndividual[][] inds
          DOCUMENT ME!
protected  int this_gen
          DOCUMENT ME!
protected  int this_grp
          DOCUMENT ME!
 
Constructor Summary
protected GenNeuralTLC.GenNeuralPopulation()
          Creates a new GenNeuralPopulation object.
protected GenNeuralTLC.GenNeuralPopulation(Infrastructure infra)
          Creates a new population of groups of GenNeural Individuals
 
Method Summary
protected  void evolve()
          Evolves the current generation of GenNeuralIndividuals in the GenNeuralPopulation into a new one.
protected  int getCurrentGenerationNum()
          DOCUMENT ME!
protected  GenNeuralTLC.GenNeuralIndividual[] getIndividuals()
          DOCUMENT ME!
protected  GenNeuralTLC.GenNeuralIndividual getNext(GenNeuralTLC.GenNeuralIndividual[] group, float totalFit)
          DOCUMENT ME!
protected  GenNeuralTLC.GenNeuralIndividual[] getNextIndividuals()
          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  GenNeuralTLC.GenNeuralIndividual[] mate(GenNeuralTLC.GenNeuralIndividual ma, GenNeuralTLC.GenNeuralIndividual pa)
          Mates two GenNeuralIndividuals creating two new GenNeuralIndividuals
protected  GenNeuralTLC.GenNeuralIndividual[] mateGroup(GenNeuralTLC.GenNeuralIndividual[] group, float totalFit)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setParentName(java.lang.String parentName_)
          DOCUMENT ME!
protected  GenNeuralTLC.GenNeuralIndividual[] sortIndsArr(GenNeuralTLC.GenNeuralIndividual[] ar)
          BubbleSorts an array of GenNeuralIndividuals on the parameter of performance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

this_grp

protected int this_grp
DOCUMENT ME!


this_gen

protected int this_gen
DOCUMENT ME!


inds

protected GenNeuralTLC.GenNeuralIndividual[][] inds
DOCUMENT ME!

Constructor Detail

GenNeuralTLC.GenNeuralPopulation

protected GenNeuralTLC.GenNeuralPopulation(Infrastructure infra)
Creates a new population of groups of GenNeural Individuals

Parameters:
infra - The Infrastructure the population will run on

GenNeuralTLC.GenNeuralPopulation

protected GenNeuralTLC.GenNeuralPopulation()
Creates a new GenNeuralPopulation object.

Method Detail

getCurrentGenerationNum

protected int getCurrentGenerationNum()
DOCUMENT ME!

Returns:
the number of the current generation of individuals

getIndividuals

protected GenNeuralTLC.GenNeuralIndividual[] getIndividuals()
DOCUMENT ME!

Returns:
the current individual

getNextIndividuals

protected GenNeuralTLC.GenNeuralIndividual[] getNextIndividuals()
DOCUMENT ME!

Returns:
DOCUMENT ME!

sortIndsArr

protected GenNeuralTLC.GenNeuralIndividual[] sortIndsArr(GenNeuralTLC.GenNeuralIndividual[] ar)
BubbleSorts an array of GenNeuralIndividuals on the parameter of performance

Parameters:
ar - the array to be sorted
Returns:
the sorted array

mate

protected GenNeuralTLC.GenNeuralIndividual[] mate(GenNeuralTLC.GenNeuralIndividual ma,
                                                  GenNeuralTLC.GenNeuralIndividual pa)
Mates two GenNeuralIndividuals creating two new GenNeuralIndividuals

Parameters:
ma - The mamma-GenNeuralIndividual
pa - The pappa-GenNeuralIndividual
Returns:
an array of length 2 of two newborn GenNeuralIndividuals

mateGroup

protected GenNeuralTLC.GenNeuralIndividual[] mateGroup(GenNeuralTLC.GenNeuralIndividual[] group,
                                                       float totalFit)
DOCUMENT ME!

Parameters:
group - DOCUMENT ME!
totalFit - DOCUMENT ME!
Returns:
DOCUMENT ME!

getNext

protected GenNeuralTLC.GenNeuralIndividual getNext(GenNeuralTLC.GenNeuralIndividual[] group,
                                                   float totalFit)
DOCUMENT ME!

Parameters:
group - DOCUMENT ME!
totalFit - DOCUMENT ME!
Returns:
DOCUMENT ME!

evolve

protected void evolve()
Evolves the current generation of GenNeuralIndividuals in the GenNeuralPopulation into a new one.


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!

loadSecondStage

public void loadSecondStage(java.util.Dictionary dictionaries)
                     throws XMLTreeException,
                            XMLInvalidInputException
DOCUMENT ME!

Specified by:
loadSecondStage in interface TwoStageLoader
Parameters:
dictionaries - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!