jaga.control
Class StandardInteractionModel

java.lang.Object
  |
  +--jaga.control.StandardInteractionModel
All Implemented Interfaces:
InteractionModel, java.io.Serializable

public class StandardInteractionModel
extends java.lang.Object
implements InteractionModel

Implementation of the InteractionModel representing a single population, single experiment model in which evaluations of individuals are independent of each other and performed one by one.

It needs an Evolver, a Deployment and an Experiment to be instantiated.

See Also:
Serialized Form

Constructor Summary
StandardInteractionModel(Evolver evo, Deployment dep, Experiment exp)
          Creates new StandardInteractionModel
StandardInteractionModel(Evolver evo, Deployment dep, Experiment exp, int iss)
          Creates new StandardInteractionModel
 
Method Summary
 double[] evaluate(Genotype[] inds)
          Evaluates these individuals using the deployment and experiments and procedure of this model.
 double[] evaluateNext()
          Should be same as calling evaluate( pickIndividuals() );
 int evaluationsPerGeneration()
          Returns the number of evaluations per generation to be performed
 void evolve()
          Evolves to the next generation of all/some of the populations involved.
 Genotype getMaxFitness()
           
 Genotype[] getNextIndividuals()
          Picks a number of individuals to be evaluated next.
 int getNumEvolvers()
           
 Population[] getPopulations()
          Returns the current populations of the evolvers
 islandev.SnapshotPainter getSnapshotPainter()
           
 Genotype[] pickIndividuals()
          Returns randomly picked individuals from the evolvers.
 void setPopulations(Population[] pops)
          Sets the populations of the evolvers to be these
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardInteractionModel

public StandardInteractionModel(Evolver evo,
                                Deployment dep,
                                Experiment exp)
Creates new StandardInteractionModel

StandardInteractionModel

public StandardInteractionModel(Evolver evo,
                                Deployment dep,
                                Experiment exp,
                                int iss)
Creates new StandardInteractionModel
Method Detail

evaluationsPerGeneration

public int evaluationsPerGeneration()
Returns the number of evaluations per generation to be performed
Specified by:
evaluationsPerGeneration in interface InteractionModel
Following copied from interface: jaga.control.InteractionModel
Returns:
the number of evaluations per generation to be performed

getNextIndividuals

public Genotype[] getNextIndividuals()
Picks a number of individuals to be evaluated next. These individuals can be from any of the populations as long as there is a standard interface between the caller and this method implementation as to where each come from. Example: may be first element a pac-man, and five others all ghosts..
Specified by:
getNextIndividuals in interface InteractionModel

evaluate

public double[] evaluate(Genotype[] inds)
Evaluates these individuals using the deployment and experiments and procedure of this model.
Specified by:
evaluate in interface InteractionModel
Following copied from interface: jaga.control.InteractionModel
Returns:
an array of the fitnesses of the individuals.

evaluateNext

public double[] evaluateNext()
Should be same as calling evaluate( pickIndividuals() );
Specified by:
evaluateNext in interface InteractionModel
Following copied from interface: jaga.control.InteractionModel
Returns:
an array of the fitnesses of the individuals.

evolve

public void evolve()
Evolves to the next generation of all/some of the populations involved.
Specified by:
evolve in interface InteractionModel

getNumEvolvers

public int getNumEvolvers()
Specified by:
getNumEvolvers in interface InteractionModel
Following copied from interface: jaga.control.InteractionModel
Returns:
the number of evolvers (ie. populations) acting in this model.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

pickIndividuals

public Genotype[] pickIndividuals()
Returns randomly picked individuals from the evolvers.
Specified by:
pickIndividuals in interface InteractionModel
Following copied from interface: jaga.control.InteractionModel
Returns:
randomly picked individuals from the evolvers.

getPopulations

public Population[] getPopulations()
Returns the current populations of the evolvers
Specified by:
getPopulations in interface InteractionModel
Following copied from interface: jaga.control.InteractionModel
Returns:
the current populations of the evolvers.

getSnapshotPainter

public islandev.SnapshotPainter getSnapshotPainter()
Specified by:
getSnapshotPainter in interface InteractionModel
Returns:
String displaying performance of fittest individual.

getMaxFitness

public Genotype getMaxFitness()
Specified by:
getMaxFitness in interface InteractionModel
Returns:
The maximum fitness a genotype can achieve. ie. when evolution will stop

setPopulations

public void setPopulations(Population[] pops)
Sets the populations of the evolvers to be these
Specified by:
setPopulations in interface InteractionModel