Operator.Operations
Class FitnessEvaluationOperation

java.lang.Object
  extended by Operator.Operations.FitnessEvaluationOperation
All Implemented Interfaces:
Operation, ParameterI

public class FitnessEvaluationOperation
extends java.lang.Object
implements Operation

Operation for evaluating the fitness. Has a FitnessFunction. Map the individual. If vallid evaluate. Set fitness.

Author:
erikhemberg

Constructor Summary
FitnessEvaluationOperation(FitnessFunction ff)
          Creates a new instance of FitnessEvaluationOperation
 
Method Summary
 void doOperation(Individual operand)
          Evaluates Individuals that are not alreadt evaluated.
 void doOperation(java.util.List<Individual> operands)
          Performs the operation on the list passed
 FitnessFunction getFitnessFunction()
          Get the fitness function
 int getOriginalPopulationSize()
           
 int getPopulationSize()
           
 void setPopulationSize(int populationSize)
           
 void setProperties(java.util.Properties p)
          Get the size of the population, and use this to determine the size of the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitnessEvaluationOperation

public FitnessEvaluationOperation(FitnessFunction ff)
Creates a new instance of FitnessEvaluationOperation

Parameters:
ff - fitness function
Method Detail

getPopulationSize

public int getPopulationSize()

setPopulationSize

public void setPopulationSize(int populationSize)

doOperation

public void doOperation(Individual operand)
Evaluates Individuals that are not alreadt evaluated. Map the individual. If valid call the fitnessFunction.getFitness(Individual operand) to evaluate and set the fitness. invalid individuals get the default fitness. Mark the individual as evaluated.

Specified by:
doOperation in interface Operation
Parameters:
operand - Individual to evaluate

setProperties

public void setProperties(java.util.Properties p)
Get the size of the population, and use this to determine the size of the cache. The cache is set to GENERATIONS_SURVIVAL times the size of the population

Specified by:
setProperties in interface ParameterI
Parameters:
p - object containing properties

getOriginalPopulationSize

public int getOriginalPopulationSize()

doOperation

public void doOperation(java.util.List<Individual> operands)
Description copied from interface: Operation
Performs the operation on the list passed

Specified by:
doOperation in interface Operation
Parameters:
operands - operands to be operated on

getFitnessFunction

public FitnessFunction getFitnessFunction()
Get the fitness function

Returns:
fitness function