A wrapper around a solution that automatically caches the fitness value
Evaluating the fitness of solutions is nearly always the most computationally intensive
part of an evolutionary algorithm. This wrapper type makes it so that that computation
will only ever happen once for every distinct individual. It implements Solution itself,
so you can use the exact same interface you would if it weren’t there.
Delete any cached fitness value.
Returns the fitness value that was cached, if it existed.
Be careful with this method;
you should not generally need to use it.
Using it incorrectly can cause evaluations to be repeated
unnecessarily, leading to heavy slowdowns.
The type that represents this solution’s fitness.
For most applications, you’ll want to use f64 or MultiObjective for this,
but you can use any type you want.