- Main Page
- Classes
- Files

- Search for |

# moeoIBEA.h

    00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
    00002
    00003 //-----------------------------------------------------------------------------
    00004 // moeoIBEA.h
    00005 // (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
    00006 /*
    00007     This library...
    00008
    00009     Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
    00010  */
    00011 //-----------------------------------------------------------------------------
    00012
    00013 #ifndef MOEOIBEA_H_
    00014 #define MOEOIBEA_H_
    00015
    00016
    00017 #include <eoBreed.h>
    00018 #include <eoContinue.h>
    00019 #include <eoEvalFunc.h>
    00020 #include <eoGenContinue.h>
    00021 #include <eoGeneralBreeder.h>
    00022 #include <eoGenOp.h>
    00023 #include <eoPopEvalFunc.h>
    00024 #include <eoSGAGenOp.h>
    00025 #include <algo/moeoEA.h>
    00026 #include <diversity/moeoDummyDiversityAssignment.h>
    00027 #include <fitness/moeoIndicatorBasedFitnessAssignment.h>
    00028 #include <metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h>
    00029 #include <replacement/moeoEnvironmentalReplacement.h>
    00030 #include <selection/moeoDetTournamentSelect.h>
    00031
    00037 template < class MOEOT >
    00038 class moeoIBEA : public moeoEA < MOEOT >
    00039 {
    00040 public:
    00041
    00043     typedef typename MOEOT::ObjectiveVector ObjectiveVector;
    00044
    00045
    00054     moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
    00055             defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
    00056             fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
    00057     {}
    00058
    00059
    00068     moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
    00069             defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select(2),
    00070             fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
    00071     {}
    00072
    00073
    00085     moeoIBEA (unsigned int _maxGen, eoEvalFunc < MOEOT > & _eval, eoQuadOp < MOEOT > & _crossover, double _pCross, eoMonOp < MOEOT > & _mutation, double _pMut, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
    00086             defaultGenContinuator(_maxGen), continuator(defaultGenContinuator), popEval(_eval), select (2),
    00087             fitnessAssignment(_metric, _kappa), replace (fitnessAssignment, dummyDiversityAssignment), defaultSGAGenOp(_crossover, _pCross, _mutation, _pMut),
    00088             genBreed (select, defaultSGAGenOp), breed (genBreed)
    00089     {}
    00090
    00091
    00100     moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
    00101             continuator(_continuator), popEval(_eval), select(2),
    00102             fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
    00103     {}
    00104
    00105
    00114     moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoTransform < MOEOT > & _op, moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > & _metric, const double _kappa=0.05) :
    00115             continuator(_continuator), popEval(_eval), select(2),
    00116             fitnessAssignment(_metric, _kappa), replace(fitnessAssignment, dummyDiversityAssignment), genBreed(select, _op), breed(genBreed)
    00117     {}
    00118
    00119
    00124     virtual void operator () (eoPop < MOEOT > &_pop)
    00125     {
    00126         eoPop < MOEOT > offspring, empty_pop;
    00127         popEval (empty_pop, _pop);      // a first eval of _pop
    00128         // evaluate fitness and diversity
    00129         fitnessAssignment(_pop);
    00130         dummyDiversityAssignment(_pop);
    00131         do
    00132         {
    00133             // generate offspring, worths are recalculated if necessary
    00134             breed (_pop, offspring);
    00135             // eval of offspring
    00136             popEval (_pop, offspring);
    00137             // after replace, the new pop is in _pop. Worths are recalculated if necessary
    00138             replace (_pop, offspring);
    00139         } while (continuator (_pop));
    00140     }
    00141
    00142
    00143 protected:
    00144
    00146     eoGenContinue < MOEOT > defaultGenContinuator;
    00148     eoContinue < MOEOT > & continuator;
    00150     eoPopLoopEval < MOEOT > popEval;
    00152     moeoDetTournamentSelect < MOEOT > select;
    00154     moeoIndicatorBasedFitnessAssignment < MOEOT > fitnessAssignment;
    00156     moeoDummyDiversityAssignment < MOEOT > dummyDiversityAssignment;
    00158     moeoEnvironmentalReplacement < MOEOT > replace;
    00160     eoSGAGenOp < MOEOT > defaultSGAGenOp;
    00162     eoGeneralBreeder < MOEOT > genBreed;
    00164     eoBreed < MOEOT > & breed;
    00165
    00166 };
    00167
    00168 #endif /*MOEOIBEA_H_*/