jaga.control
Class JobInterviewIM

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

public abstract class JobInterviewIM
extends java.lang.Object
implements InteractionModel

Interaction Model which has nrRounds rounds of evaluation. Usually each would be of increasing difficulty and cost, so that only individuals close to the top of the rank table are evaluated precisely. Only those individuals whose fitness at the previous round was greater than the fitness of the best minus a threshold will pass to the next round. These thresholds and what fitness measure each round defines are configured through thresholds and roundTargets respectively.

This version is written to allow multiple populations, with one of them being the main one which dominates when to go to the next round, etc...

To use this class all that needs to be done is to implement the evaluate method, this should look at the currRound to know which round the evaluation is taking place in. Rounds start counting at 0.

See Also:
Serialized Form

Constructor Summary
JobInterviewIM(Evolver[] allEvolvers, int numOfRounds, double[][] nextRoundFilterThresholds, int[] roundTargetsForFitnessMeasures, islandev.SnapshotPainter painter)
          Creates a new instance of JobInterviewIM - For multiple populations
JobInterviewIM(Evolver evolver, int numOfRounds, double[] nextRoundFilterThresholds, int[] roundTargetsForFitnessMeasures, islandev.SnapshotPainter painter)
          Constructor for single population
 
Method Summary
 double[] evaluateNext()
          Should be same as calling evaluate( pickIndividuals() );
 int evaluationsPerGeneration()
           
 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()
           
 islandev.SnapshotPainter getSnapshotPainter()
           
 Genotype[] pickIndividuals()
           
 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
 
Methods inherited from interface jaga.control.InteractionModel
evaluate
 

Constructor Detail

JobInterviewIM

public JobInterviewIM(Evolver[] allEvolvers,
                      int numOfRounds,
                      double[][] nextRoundFilterThresholds,
                      int[] roundTargetsForFitnessMeasures,
                      islandev.SnapshotPainter painter)
Creates a new instance of JobInterviewIM - For multiple populations

JobInterviewIM

public JobInterviewIM(Evolver evolver,
                      int numOfRounds,
                      double[] nextRoundFilterThresholds,
                      int[] roundTargetsForFitnessMeasures,
                      islandev.SnapshotPainter painter)
Constructor for single population
Method Detail

evaluateNext

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

evaluationsPerGeneration

public int evaluationsPerGeneration()
Specified by:
evaluationsPerGeneration in interface InteractionModel
Returns:
the number of evaluations per generation to be performed

evolve

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

getMaxFitness

public Genotype getMaxFitness()
Specified by:
getMaxFitness in interface InteractionModel
Returns:
A Genotype with the maximum fitness a genotype can achieve (ie. when evolution will stop). This may have fitness and properties too.

getNextIndividuals

public Genotype[] getNextIndividuals()
Picks a number of individuals to be evaluated next. Checks if we've reached end of each round and moves on to next. Also in charge of changing the return value of evaluationsPerGeneration().
Specified by:
getNextIndividuals in interface InteractionModel

getNumEvolvers

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

getPopulations

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

pickIndividuals

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

setPopulations

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

getSnapshotPainter

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

toString

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