AgE 2.7 : Evaluations

Evaluations

ISolutionEvaluator

ISolutionEvaluator<S extends ISolution> is a strategy interface for evaluating solutions. It is parameterized by the type of solutions it supports.

When given a solution, evaluators should return a double value. This value is the fitness of the solution in the context of the problem being solved.

Minimalization

Generally, evolutionary algorithms aim to maximize the fitness function. If you are given with a cost function you need to minimize instead, you will need to transform it somehow into a fitness function. It may be usually done by negating the cost function.

Evaluators may or may not be idempotent - they may return the same value when asked about an identical solution (with regard to representation), or they may return a different value on each consecutive evaluation.

 

Caching

There already was a try to cache evaluators' results with a caching decorator. However, even for small problem spaces the cache hit-rate was close to zero, while hash code computations and accesses to the underlying map caused more overhead than it saved.