2#include "TermFitnessValOp.h"
7 double *value =
new double(0);
8 state->getRegistry()->registerEntry(
"term.fitnessval", (voidP) value, ECF::DOUBLE,
9 "fitness value for termination (default: none)");
15 if(!state->getRegistry()->isModified(
"term.fitnessval"))
18 voidP sptr = state->getRegistry()->getEntry(
"term.fitnessval");
19 termValue_ = *((
double*) sptr.get());
27 double minFitness = state->getStats()->getFitnessMin();
28 double maxFitness = state->getStats()->getFitnessMax();
30 if(termValue_ >= minFitness && termValue_ <= maxFitness) {
31 state->setTerminateCond();
32 ECF_LOG(state, 1,
"Termination: fitness value (" + dbl2str(termValue_) +
") reached");
bool operate(StateP)
perform the designated operation
void registerParameters(StateP)
Register parameters with the Registry. Called before Operator::initialize.
bool initialize(StateP)
Perform initialization. Called before Operator::operate. By default, if the return value is false,...