//----------------------------------------------------------------------------- // t-moStdDevEstimator.cpp //----------------------------------------------------------------------------- #include #include "es/eoReal.h" #include "continuator/moFitnessVarianceStat.h" #include "neighborhood/moRealNeighbor.h" #include "neighborhood/moRealNeighborhood.h" //Representation and initializer #include #include #include // fitness function #include #include #include //Neighbors and Neighborhoods #include #include //Algorithm and its components #include #include //comparator #include #include //----------------------------------------------------------------------------- // Define types of the representation solution, different neighbors and neighborhoods //----------------------------------------------------------------------------- typedef eoInt Queen; //Permutation (Queen's problem representation) typedef moShiftNeighbor shiftNeighbor; //shift Neighbor typedef moRndWithReplNeighborhood rndShiftNeighborhood; //rnd shift Neighborhood (Indexed) //----------------------------------------------------------------------------- typedef eoReal< eoMinimizingFitness > EOT; typedef moRealNeighbor< EOT > Neighbor; int main(int ac, char** av) { unsigned vecSize = 8; queenEval fullEval; eoInitPermutation init(vecSize); //moFullEvalByCopy shiftEval(fullEval); /// by default rndShiftNeighborhood rndShiftNH((vecSize-1) * (vecSize-1)); Queen solution; init(solution); fullEval(solution); moStdDevEstimator initTemp (500, rndShiftNH, fullEval); std::cout << "temp: " << initTemp(solution) << std::endl; //assert(stat.value() == 625); }