From 88061395f12b6b387c849103f6bdccc4c953f332 Mon Sep 17 00:00:00 2001 From: evomarc Date: Tue, 3 Jul 2001 12:56:44 +0000 Subject: [PATCH] Added the eoPopEvalFunc class: gets the full parents + offspring populations in order to evaluate them. Modified eoEaseyEA accordingly - you can either pass an eoEvalFunc, as before (it is then encapsulated into an eoPopLoopEval that does the good old loop on the offspring - or directly pass a full eoPopEvalFunc Small modification also in make_op_es -> keyword "none" is now recognized for one of the crossover of either object variables or stdev's --- eo/src/es/make_op_es.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eo/src/es/make_op_es.h b/eo/src/es/make_op_es.h index 91274a24..40d72ddd 100644 --- a/eo/src/es/make_op_es.h +++ b/eo/src/es/make_op_es.h @@ -102,8 +102,8 @@ eoGenOp & do_make_op(eoParameterLoader& _parser, eoState& _state, eoRealIni // ES crossover eoValueParam& crossTypeParam = _parser.createParam(string("global"), "crossType", "Type of ES recombination (global or standard)", 'C', "Variation Operators"); - eoValueParam& crossObjParam = _parser.createParam(string("discrete"), "crossObj", "Recombination of object variables (discrete or intermediate)", 'O', "Variation Operators"); - eoValueParam& crossStdevParam = _parser.createParam(string("intermediate"), "crossStdev", "Recombination of mutation strategy parameters (intermediate or discrete)", 'S', "Variation Operators"); + eoValueParam& crossObjParam = _parser.createParam(string("discrete"), "crossObj", "Recombination of object variables (discrete, intermediate or none)", 'O', "Variation Operators"); + eoValueParam& crossStdevParam = _parser.createParam(string("intermediate"), "crossStdev", "Recombination of mutation strategy parameters (intermediate, discrete or none)", 'S', "Variation Operators"); // The pointers: first the atom Xover eoBinOp *ptObjAtomCross = NULL; @@ -116,12 +116,16 @@ eoGenOp & do_make_op(eoParameterLoader& _parser, eoState& _state, eoRealIni ptObjAtomCross = new eoDoubleExchange; else if (crossObjParam.value() == string("intermediate")) ptObjAtomCross = new eoDoubleIntermediate; + else if (crossObjParam.value() == string("none")) + ptObjAtomCross = new eoBinCloneOp; else throw runtime_error("Invalid Object variable crossover type"); if (crossStdevParam.value() == string("discrete")) ptStdevAtomCross = new eoDoubleExchange; else if (crossStdevParam.value() == string("intermediate")) ptStdevAtomCross = new eoDoubleIntermediate; + else if (crossStdevParam.value() == string("none")) + ptStdevAtomCross = new eoBinCloneOp; else throw runtime_error("Invalid mutation strategy parameter crossover type"); // and build the indi Xover