Correct types for fitness assignment in IBEA
While the default fitness assignment of IBEA is the Exp indicator one, the used interface is a binary indicator.
This commit is contained in:
parent
83673d48b2
commit
a7134a658c
2 changed files with 6 additions and 6 deletions
|
|
@ -160,7 +160,7 @@ public:
|
|||
* @param _op variation operators
|
||||
* @param _fitnessAssignment fitness assignment
|
||||
*/
|
||||
moeoIBEA (eoContinue < MOEOT > & _continuator, eoPopEvalFunc < MOEOT > & _popEval, eoGenOp < MOEOT > & _op, moeoExpBinaryIndicatorBasedFitnessAssignment < MOEOT >& _fitnessAssignment) :
|
||||
moeoIBEA (eoContinue < MOEOT > & _continuator, eoPopEvalFunc < MOEOT > & _popEval, eoGenOp < MOEOT > & _op, moeoBinaryIndicatorBasedFitnessAssignment < MOEOT >& _fitnessAssignment) :
|
||||
defaultGenContinuator(0), continuator(_continuator), eval(defaultEval), defaultPopEval(eval), popEval(_popEval), select(2),
|
||||
selectMany(select,0.0), selectTransform(defaultSelect, defaultTransform), defaultSGAGenOp(defaultQuadOp, 1.0, defaultMonOp, 1.0), genBreed(select, _op), breed(genBreed), default_fitnessAssignment(NULL), fitnessAssignment(_fitnessAssignment), replace(fitnessAssignment, diversityAssignment)
|
||||
{}
|
||||
|
|
@ -173,7 +173,7 @@ public:
|
|||
* @param _op variation operators
|
||||
* @param _fitnessAssignment fitness assignment
|
||||
*/
|
||||
moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoExpBinaryIndicatorBasedFitnessAssignment < MOEOT >& _fitnessAssignment) :
|
||||
moeoIBEA (eoContinue < MOEOT > & _continuator, eoEvalFunc < MOEOT > & _eval, eoGenOp < MOEOT > & _op, moeoBinaryIndicatorBasedFitnessAssignment < MOEOT >& _fitnessAssignment) :
|
||||
defaultGenContinuator(0), continuator(_continuator), eval(_eval), defaultPopEval(_eval), popEval(defaultPopEval), select(2),
|
||||
selectMany(select,0.0), selectTransform(defaultSelect, defaultTransform), defaultSGAGenOp(defaultQuadOp, 1.0, defaultMonOp, 1.0), genBreed(select, _op), breed(genBreed), default_fitnessAssignment(NULL), fitnessAssignment(_fitnessAssignment), replace(fitnessAssignment, diversityAssignment)
|
||||
{}
|
||||
|
|
@ -190,7 +190,7 @@ public:
|
|||
* Apply the algorithm to the population _pop until the stopping criteria is satified.
|
||||
* @param _pop the population
|
||||
*/
|
||||
virtual void operator () (eoPop < MOEOT > &_pop)
|
||||
virtual void operator() (eoPop < MOEOT > &_pop)
|
||||
{
|
||||
eoPop < MOEOT > offspring, empty_pop;
|
||||
popEval (empty_pop, _pop); // a first eval of _pop
|
||||
|
|
@ -260,7 +260,7 @@ protected:
|
|||
/** breeder */
|
||||
eoBreed < MOEOT > & breed;
|
||||
/** fitness assignment used in IBEA */
|
||||
moeoExpBinaryIndicatorBasedFitnessAssignment < MOEOT >& fitnessAssignment;
|
||||
moeoBinaryIndicatorBasedFitnessAssignment < MOEOT >& fitnessAssignment;
|
||||
moeoExpBinaryIndicatorBasedFitnessAssignment < MOEOT >* default_fitnessAssignment;
|
||||
/** dummy diversity assignment */
|
||||
moeoDummyDiversityAssignment < MOEOT > diversityAssignment;
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class moeoExpBinaryIndicatorBasedFitnessAssignment : public moeoBinaryIndicatorB
|
|||
* Compute every indicator value in values (values[i] = I(_v[i], _o))
|
||||
* @param _pop the population
|
||||
*/
|
||||
void computeValues(const eoPop < MOEOT > & _pop)
|
||||
virtual void computeValues(const eoPop < MOEOT > & _pop)
|
||||
{
|
||||
values.clear();
|
||||
values.resize(_pop.size());
|
||||
|
|
@ -211,7 +211,7 @@ class moeoExpBinaryIndicatorBasedFitnessAssignment : public moeoBinaryIndicatorB
|
|||
* Returns the fitness value of the _idx th individual of the population
|
||||
* @param _idx the index
|
||||
*/
|
||||
Type computeFitness(const unsigned int _idx)
|
||||
virtual Type computeFitness(const unsigned int _idx)
|
||||
{
|
||||
Type result(0.0);
|
||||
for (unsigned int i=0; i<values.size(); i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue