update for deleting roulette
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@270 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
5c83597d61
commit
6adfd7bbc4
3 changed files with 0 additions and 84 deletions
|
|
@ -35,7 +35,6 @@
|
||||||
#include <moeoIndicatorBasedFitnessAssignment.h>
|
#include <moeoIndicatorBasedFitnessAssignment.h>
|
||||||
#include <moeoRandomSelect.h>
|
#include <moeoRandomSelect.h>
|
||||||
#include <moeoReplacement.h>
|
#include <moeoReplacement.h>
|
||||||
#include <moeoRouletteSelect.h>
|
|
||||||
#include <moeoSelectOne.h>
|
#include <moeoSelectOne.h>
|
||||||
#include <moeoStochTournamentSelect.h>
|
#include <moeoStochTournamentSelect.h>
|
||||||
#include <metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h>
|
#include <metric/moeoNormalizedSolutionVsSolutionBinaryMetric.h>
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@
|
||||||
#include <moeoObjectiveVector.h>
|
#include <moeoObjectiveVector.h>
|
||||||
#include <moeoRandomSelect.h>
|
#include <moeoRandomSelect.h>
|
||||||
#include <moeoReplacement.h>
|
#include <moeoReplacement.h>
|
||||||
#include <moeoRouletteSelect.h>
|
|
||||||
#include <moeoSelectFromPopAndArch.h>
|
#include <moeoSelectFromPopAndArch.h>
|
||||||
#include <moeoSelectOne.h>
|
#include <moeoSelectOne.h>
|
||||||
#include <moeoStochTournamentSelect.h>
|
#include <moeoStochTournamentSelect.h>
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// moeoRouletteSelect.h
|
|
||||||
// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007
|
|
||||||
/*
|
|
||||||
This library...
|
|
||||||
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef MOEOROULETTESELECT_H_
|
|
||||||
#define MOEOROULETTESELECT_H_
|
|
||||||
|
|
||||||
#include <moeoSelectOne.h>
|
|
||||||
#include <moeoSelectors.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Selection strategy that selects ONE individual by using roulette wheel process.
|
|
||||||
*/
|
|
||||||
template < class MOEOT >
|
|
||||||
class moeoRouletteSelect:public moeoSelectOne <MOEOT>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Full Ctor.
|
|
||||||
* @param _comparator the comparator (used to compare 2 individuals)
|
|
||||||
* @param _tSize the number of individuals in the tournament (default: 2)
|
|
||||||
*/
|
|
||||||
moeoRouletteSelect (moeoComparator < MOEOT > &_comparator, unsigned _tSize = 2):
|
|
||||||
comparator (_comparator), tSize (_tSize)
|
|
||||||
{
|
|
||||||
// consistency check
|
|
||||||
if (tSize < 2)
|
|
||||||
{
|
|
||||||
std::
|
|
||||||
cout << "Warning, Tournament size should be >= 2\nAdjusted to 2\n";
|
|
||||||
tSize = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ctor without comparator. A moeoFitnessThenDiversityComparator is used as default.
|
|
||||||
* @param _tSize the number of individuals in the tournament (default: 2)
|
|
||||||
*/
|
|
||||||
moeoRouletteSelect (unsigned _tSize = 2):
|
|
||||||
comparator (*(new moeoFitnessThenDiversityComparator < MOEOT > ())),
|
|
||||||
tSize (_tSize)
|
|
||||||
{
|
|
||||||
// consistency check
|
|
||||||
if (tSize < 2)
|
|
||||||
{
|
|
||||||
std::
|
|
||||||
cout << "Warning, Tournament size should be >= 2\nAdjusted to 2\n";
|
|
||||||
tSize = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Apply the tournament to the given population
|
|
||||||
*/
|
|
||||||
const MOEOT & operator () (const eoPop < MOEOT > &_pop)
|
|
||||||
{
|
|
||||||
// use the selector
|
|
||||||
return mo_roulette_wheel(_pop,tSize); //comparator ??
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/** comparator */
|
|
||||||
moeoComparator < MOEOT > &comparator;
|
|
||||||
/** size */
|
|
||||||
double & tSize;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /*MOEOROULETTESELECT_H_ */
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue