com.parabon.ec.simple
Class SimpleBoundedFitness
java.lang.Object
ec.Fitness
ec.simple.SimpleFitness
com.parabon.ec.simple.SimpleBoundedFitness
- All Implemented Interfaces:
- Prototype, Setup, java.io.Serializable, java.lang.Cloneable
public class SimpleBoundedFitness
- extends SimpleFitness
A SimpleBoundedFitness is a SimpleFitness with
an arbitrary upper bound. Once the fitness exceeds this bound the fitness
is considered to be "ideal".
- Author:
- Curt Larock
- See Also:
- Serialized Form
|
Method Summary |
boolean |
betterThan(Fitness fitness)
Should return true if this fitness is clearly better than _fitness;
You may assume that _fitness is of the same class as yourself. |
boolean |
isIdealFitness()
Should return true if this is a good enough fitness to end the run |
void |
setup(EvolutionState state,
Parameter base)
Sets up the object by reading it from the parameters stored
in state, built off of the parameter base base. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P_BEST_TYPE
public static final java.lang.String P_BEST_TYPE
- See Also:
- Constant Field Values
P_BEST_FITNESS
public static final java.lang.String P_BEST_FITNESS
- See Also:
- Constant Field Values
P_GREATER_IS_BETTER
public static final java.lang.String P_GREATER_IS_BETTER
- See Also:
- Constant Field Values
bestFitness_
protected SimpleFitness bestFitness_
greaterIsBetter_
protected boolean greaterIsBetter_
- If true numerically greater fitness values are better.
SimpleBoundedFitness
public SimpleBoundedFitness()
setup
public void setup(EvolutionState state,
Parameter base)
- Description copied from interface:
Prototype
- Sets up the object by reading it from the parameters stored
in state, built off of the parameter base base.
If an ancestor implements this method, be sure to call
super.setup(state,base); before you do anything else.
For prototypes, setup(...) is typically called once for
the prototype instance; cloned instances do not receive
the setup(...) call. setup(...) may be called
more than once; the only guarantee is that it will get
called at least once on an instance or some "parent"
object from which it was ultimately cloned.
- Specified by:
setup in interface Prototype- Specified by:
setup in interface Setup- Overrides:
setup in class SimpleFitness
isIdealFitness
public boolean isIdealFitness()
- Description copied from class:
Fitness
- Should return true if this is a good enough fitness to end the run
- Overrides:
isIdealFitness in class SimpleFitness
betterThan
public boolean betterThan(Fitness fitness)
- Description copied from class:
Fitness
- Should return true if this fitness is clearly better than _fitness;
You may assume that _fitness is of the same class as yourself.
For any two fitnesses fit1 and fit2 of the same class,
it must be the case that fit1.equivalentTo(fit2) == fit2.equivalentTo(fit1),
and that only one of fit1.betterThan(fit2), fit1.equivalentTo(fit2),
and fit2.betterThan(fit1) can be true.
- Overrides:
betterThan in class SimpleFitness