Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::Fitness Concept Reference

#include <fitness.h>

Concept definition

template<class F>
concept ultra::Fitness =
OrderedArithmeticType<F> && requires { requires F{-1} < F{0}; }
Definition fitness.h:65

Detailed Description

This is NOT THE RAW FITNESS. Raw fitness is stated in the natural terminology of the problem: the better value may be either smaller (as when raw fitness is error) or larger (as when raw fitness is food eaten, benefit achieved...).

We use a STANDARDIZED FITNESS: a greater numerical value is always a better value (in many examples the optimal value is 0, but this isn't strictly necessary).

If, for a particular problem, a greater value of raw fitness is better, standardized fitness equals the raw fitness for that problem (otherwise standardized fitness must be computed from raw fitness).

Warning
The definition of standardized fitness given here is different from that used in Koza's "Genetic Programming: On the Programming of Computers by Means of Natural Selection". In the book a LOWER numerical value is always a better one. The main difference is that Vita attempts to maximize the fitness (while other applications try to minimize it). We chose this convention since it seemed more natural (a greater fitness is a better fitness; achieving a better fitness means to maximize the fitness). The downside is that sometimes we have to manage negative numbers, but for our purposes it's not so bad. Anyway maximization and minimization problems are basically the same: the solution of max(f(x)) is the same as -min(-f(x)). This is usually all you have to remember when dealing with examples/problems expressed in the other notation.
Remarks
This intentionally excludes bool, since bool{-1} < bool{0} is equivalent to true < false, which is false.