org.dbe.eve.fff.impl
Class DefaultAgregator

java.lang.Object
  extended by org.dbe.eve.fff.impl.DefaultAgregator
All Implemented Interfaces:
FitnessFunction, FitnessFunctionAggregator

public class DefaultAgregator
extends java.lang.Object
implements FitnessFunctionAggregator

A "how-to" implementation example for a FitnessFunctionAggregator. In the evaluate method, all FitnessFunctions registered wihtin the Framework are combined to produce one single FitnessValue out of several FitnessFunctions. In this ecample, the overall fitness is just the sum of all evaulation results of the simgle fitness functions. If necessary, different mechanisms of combining distinct results can be envisioned.

Author:
Claudius

Field Summary
(package private)  FitnessFunctionFramework framework
           
 
Constructor Summary
DefaultAgregator()
           
 
Method Summary
 Fitness evaluate(Solution solution)
          Evaluate the fitness function with the indicated solution.
 void init(SBVRDescription description, FitnessFunctionContext context)
          Init this fitness funcion.
 void setFramework(FitnessFunctionFramework framework)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

framework

FitnessFunctionFramework framework
Constructor Detail

DefaultAgregator

public DefaultAgregator()
Method Detail

setFramework

public void setFramework(FitnessFunctionFramework framework)
Specified by:
setFramework in interface FitnessFunctionAggregator

init

public void init(SBVRDescription description,
                 FitnessFunctionContext context)
Description copied from interface: FitnessFunction
Init this fitness funcion. At this moment, we can get any parameter from the FitnessFunctionContext of store this object in order to get the parameters later, at "evaluation" time. This will depend if we can perform all evaluations taking into account the "global system" progress or not.

Specified by:
init in interface FitnessFunction
Parameters:
description - The request that acts as the evaluation counterpart
context - The FitnessFunctionContext

evaluate

public Fitness evaluate(Solution solution)
Description copied from interface: FitnessFunction
Evaluate the fitness function with the indicated solution.

Specified by:
evaluate in interface FitnessFunction
Parameters:
solution - The Solution that should be evaluated
Returns:
fitness The calculated fitness value