sdt.ga
Class AsyncPopulation

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--sdt.ga.AsyncPopulation

public class AsyncPopulation
extends java.lang.Thread

Implementation of the Population class used in the Asynchronous GA implementations.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AsyncPopulation(AsyncGeneticAlgorithm ga)
          Create an instance of the population for an asynchronous GA, without instantiating the individuals in the population.
 
Method Summary
 void drawPop()
          A textual representation of the current population.
protected  void finalize()
          for garbage collection.
 void free()
           
 int getActiveEvolveCount()
          Returns the number of active evolve nodes.
 double getAvgFitness()
          Returns the average fitness of a generation.
 Fitness getAvgProperties()
          Returns the average properties of the generation.
 int getGenerationNumber()
          Returns the current generation number.
 AsyncGeneticAlgorithm getGeneticAlgorithm()
          Get the associated asynchronous GA.
 Organism getIncumbent()
          Returns the incumbent (current best) solution.
 Organism getOrganismAt(int i)
          Returns the candidate solution at a fixed position.
 Arc getRandomArc()
          Returns a random solution from the current population.
 AsyncPopulation getSuccessor()
          Returns the instance of the successor population.
 boolean isOrganismAt(int i)
          ???
 boolean putOrganism(Organism org)
          Places an organism in the current population in the next available position.
 void putRandomOrganisms()
          Create random solutions and fill up the population.
 void run()
          The population creates the dataflow nodes and arcs and fires them up.
 Organism seeFittestOrganism()
          examines the fittest organism.
 Organism seeOrganismAt(int i)
          Examine the token associated with a certain candidate solution.
 void setGA(AsyncGeneticAlgorithm ga)
          sets the asynchronous GA.
 void setIncumbent(Organism org)
          Sets the current best solution.
 void setPrintToken(boolean value)
          sets the print token
 java.lang.String toString()
          Returns a string representation of the current population.
 void updateEvalCount()
          Updates the evaluation count.
 void updateEvolveCount()
          Updates the number of evolve nodes remaining in the dataflow graph.
 void updateSuccessor(AsyncPopulation suc)
          The pointers to the successor population are updated.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AsyncPopulation

public AsyncPopulation(AsyncGeneticAlgorithm ga)
Create an instance of the population for an asynchronous GA, without instantiating the individuals in the population.
Method Detail

free

public void free()

getGeneticAlgorithm

public AsyncGeneticAlgorithm getGeneticAlgorithm()
Get the associated asynchronous GA.

setGA

public void setGA(AsyncGeneticAlgorithm ga)
sets the asynchronous GA.

getIncumbent

public Organism getIncumbent()
Returns the incumbent (current best) solution.

getGenerationNumber

public int getGenerationNumber()
Returns the current generation number.

putOrganism

public boolean putOrganism(Organism org)
Places an organism in the current population in the next available position.

getSuccessor

public AsyncPopulation getSuccessor()
Returns the instance of the successor population.

getRandomArc

public Arc getRandomArc()
Returns a random solution from the current population.

putRandomOrganisms

public void putRandomOrganisms()
Create random solutions and fill up the population.

getOrganismAt

public Organism getOrganismAt(int i)
Returns the candidate solution at a fixed position.

seeOrganismAt

public Organism seeOrganismAt(int i)
Examine the token associated with a certain candidate solution.

isOrganismAt

public boolean isOrganismAt(int i)
???

seeFittestOrganism

public Organism seeFittestOrganism()
examines the fittest organism.

setIncumbent

public void setIncumbent(Organism org)
Sets the current best solution.

updateEvalCount

public void updateEvalCount()
Updates the evaluation count.

getAvgProperties

public Fitness getAvgProperties()
Returns the average properties of the generation.

getAvgFitness

public double getAvgFitness()
Returns the average fitness of a generation.

drawPop

public void drawPop()
A textual representation of the current population.

toString

public java.lang.String toString()
Returns a string representation of the current population.
Overrides:
toString in class java.lang.Thread

updateSuccessor

public void updateSuccessor(AsyncPopulation suc)
The pointers to the successor population are updated. The current pointer is freed.

updateEvolveCount

public void updateEvolveCount()
Updates the number of evolve nodes remaining in the dataflow graph.

setPrintToken

public void setPrintToken(boolean value)
sets the print token

getActiveEvolveCount

public int getActiveEvolveCount()
Returns the number of active evolve nodes.

run

public void run()
The population creates the dataflow nodes and arcs and fires them up. The next generation evolves from the current one.
Overrides:
run in class java.lang.Thread

finalize

protected void finalize()
                 throws java.lang.Throwable
for garbage collection.
Overrides:
finalize in class java.lang.Object