dLife Home Page

dlife.ga
Interface FitnessFunction

All Superinterfaces:
Serializable
All Known Subinterfaces:
BatchFitnessFunction, IndividualFitnessFunction
All Known Implementing Classes:
ConstantFitnessFunction

public interface FitnessFunction
extends Serializable

A tag interface for all types of FitnessFunctions. This provides a common base for any type that can be used as a FitnessFunction with a Population. It should not be implemented directly. Instead all FitnessFunctions should implement either the IndividualFitnessFunction or the BatchFitnessFunction interface.

When a Population is constructed with an IndividualFitnessFunction the fitness of each Individual in the Population will evaluated in turn by the provided FitnessFunction. When a Population is constructed with a BatchFitnessFunction, the entire Population will be passed to the provided FitnessFunction which will set the fitness of each Individual in the Population.

Note: The Population code uses the instanceof operator to explicitly handle each different implementation of this interface. Thus if additional implementations are created, the Population class will have to be modified to deal with them also. However, it is anticipated that most (all?) cases can be handled by either implementing the IndividalFitnessFunction or the BatchFitnessFunction interfaces.

Version:
Jan 7, 2007
Author:
Grant Braught, Dickinson College


dLife Home Page