indent all
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@232 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
afae4c1eca
commit
c8049ca6cd
51 changed files with 3899 additions and 3898 deletions
|
|
@ -51,7 +51,7 @@ moeoLS < MOEOT, eoPop<MOEOT> & > & do_make_ls_moeo (
|
|||
moMoveInit < Move > & _moveInit,
|
||||
moNextMove < Move > & _nextMove,
|
||||
moeoArchive < MOEOT > & _archive
|
||||
)
|
||||
)
|
||||
{
|
||||
/* the objective vector type */
|
||||
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Base class for performance metrics (also known as quality indicators).
|
||||
*/
|
||||
class moeoMetric : public eoFunctorBase
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -27,7 +27,7 @@ class moeoMetric : public eoFunctorBase
|
|||
*/
|
||||
template < class A, class R >
|
||||
class moeoUnaryMetric : public eoUF < A, R >, public moeoMetric
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -35,7 +35,7 @@ class moeoUnaryMetric : public eoUF < A, R >, public moeoMetric
|
|||
*/
|
||||
template < class A1, class A2, class R >
|
||||
class moeoBinaryMetric : public eoBF < A1, A2, R >, public moeoMetric
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -43,7 +43,7 @@ class moeoBinaryMetric : public eoBF < A1, A2, R >, public moeoMetric
|
|||
*/
|
||||
template < class ObjectiveVector, class R >
|
||||
class moeoSolutionUnaryMetric : public moeoUnaryMetric < const ObjectiveVector &, R >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -51,7 +51,7 @@ class moeoSolutionUnaryMetric : public moeoUnaryMetric < const ObjectiveVector &
|
|||
*/
|
||||
template < class ObjectiveVector, class R >
|
||||
class moeoVectorUnaryMetric : public moeoUnaryMetric < const std::vector < ObjectiveVector > &, R >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -59,7 +59,7 @@ class moeoVectorUnaryMetric : public moeoUnaryMetric < const std::vector < Objec
|
|||
*/
|
||||
template < class ObjectiveVector, class R >
|
||||
class moeoSolutionVsSolutionBinaryMetric : public moeoBinaryMetric < const ObjectiveVector &, const ObjectiveVector &, R >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -67,7 +67,7 @@ class moeoSolutionVsSolutionBinaryMetric : public moeoBinaryMetric < const Objec
|
|||
*/
|
||||
template < class ObjectiveVector, class R >
|
||||
class moeoVectorVsVectorBinaryMetric : public moeoBinaryMetric < const std::vector < ObjectiveVector > &, const std::vector < ObjectiveVector > &, R >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
#endif /*MOEOMETRIC_H_*/
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
template < class MOEOT >
|
||||
class moeoComparator : public eoBF < const MOEOT &, const MOEOT &, const bool >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public:
|
|||
*/
|
||||
template < class MOEOT >
|
||||
class moeoScalarFitnessAssignment : public moeoFitnessAssignment < MOEOT >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -104,7 +104,7 @@ class moeoScalarFitnessAssignment : public moeoFitnessAssignment < MOEOT >
|
|||
*/
|
||||
template < class MOEOT >
|
||||
class moeoCriterionBasedFitnessAssignment : public moeoFitnessAssignment < MOEOT >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -112,7 +112,7 @@ class moeoCriterionBasedFitnessAssignment : public moeoFitnessAssignment < MOEOT
|
|||
*/
|
||||
template < class MOEOT >
|
||||
class moeoParetoBasedFitnessAssignment : public moeoFitnessAssignment < MOEOT >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
#endif /*MOEOFITNESSASSIGNMENT_H_*/
|
||||
|
|
|
|||
|
|
@ -84,16 +84,16 @@ public:
|
|||
moeoArchive < MOEOT > previousArchive;
|
||||
// update the archive with the initial population
|
||||
archive.update(_pop);
|
||||
unsigned counter=0;
|
||||
unsigned counter=0;
|
||||
do
|
||||
{
|
||||
previousArchive.update(archive);
|
||||
oneStep(_pop);
|
||||
archive.update(_pop);
|
||||
counter++;
|
||||
counter++;
|
||||
} while ( (! archive.equals(previousArchive)) && (continuator(_arch)) );
|
||||
_arch.update(archive);
|
||||
cout << "\t=> " << counter << " step(s)" << endl;
|
||||
cout << "\t=> " << counter << " step(s)" << endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -87,14 +87,14 @@ public:
|
|||
{
|
||||
|
||||
_arch.update(_pop);
|
||||
cout << endl << endl << "***** IBMOLS 1" << endl;
|
||||
unsigned counter = 2;
|
||||
cout << endl << endl << "***** IBMOLS 1" << endl;
|
||||
unsigned counter = 2;
|
||||
ibmols(_pop, _arch);
|
||||
while (continuator(_arch))
|
||||
{
|
||||
// generate new solutions from the archive
|
||||
generateNewSolutions(_pop, _arch);
|
||||
cout << endl << endl << "***** IBMOLS " << counter++ << endl;
|
||||
cout << endl << endl << "***** IBMOLS " << counter++ << endl;
|
||||
// apply the local search (the global archive is updated in the sub-function)
|
||||
ibmols(_pop, _arch);
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ private:
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// A DEVELOPPER RAPIDEMENT POUR TESTER AVEC CROSSOVER //
|
||||
/*
|
||||
/*
|
||||
void generateNewSolutions2(eoPop < MOEOT > & _pop, const moeoArchive < MOEOT > & _arch)
|
||||
{
|
||||
// here, we must have a QuadOp !
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@
|
|||
*/
|
||||
template < class MOEOT, class Type >
|
||||
class moeoLS: public eoBF < Type, moeoArchive < MOEOT > &, void >
|
||||
{};
|
||||
{};
|
||||
|
||||
#endif /*MOEOLS_H_*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
template < class Move >
|
||||
class moeoMoveIncrEval : public eoBF < const Move &, const typename Move::EOType &, typename Move::EOType::ObjectiveVector >
|
||||
{};
|
||||
{};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
template < class ObjectiveVector >
|
||||
class moeoObjectiveVectorComparator : public eoBF < const ObjectiveVector &, const ObjectiveVector &, bool >
|
||||
{};
|
||||
{};
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@
|
|||
*/
|
||||
template < class MOEOT >
|
||||
class moeoReplacement : public eoReplacement < MOEOT >
|
||||
{};
|
||||
{};
|
||||
|
||||
#endif /*MOEOREPLACEMENT_H_*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ It mo_deterministic_tournament(It _begin, It _end, unsigned _t_size,moeoComparat
|
|||
It competitor = _begin + _gen.random(_end - _begin);
|
||||
|
||||
// compare the two individuals by using the comparator
|
||||
if(_comparator(*best,*competitor))
|
||||
if (_comparator(*best,*competitor))
|
||||
|
||||
// best "better" than competitor
|
||||
best=competitor;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
|
||||
|
||||
} catch(exception& e) {
|
||||
} catch (exception& e) {
|
||||
cout << e.what() << endl;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
vector<unsigned> scheduling(N);
|
||||
// initialisation of possible values
|
||||
vector<unsigned> possibles(N);
|
||||
for(unsigned i=0 ; i<N ; i++)
|
||||
for (unsigned i=0 ; i<N ; i++)
|
||||
possibles[i] = i;
|
||||
// random initialization
|
||||
unsigned rInd; // random index
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ private:
|
|||
unsigned i = _point1+1;
|
||||
unsigned j = 0;
|
||||
while (i<_point2 && j<_parent2.size()) {
|
||||
if(! taken_values[_parent2[j]]) {
|
||||
if (! taken_values[_parent2[j]]) {
|
||||
result[i] = _parent2[j];
|
||||
i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
else direction = -1;
|
||||
// mutation
|
||||
tmp = resultScheduling[point1];
|
||||
for(unsigned i=point1 ; i!=point2 ; i+=direction)
|
||||
for (unsigned i=point1 ; i!=point2 ; i+=direction)
|
||||
resultScheduling[i] = resultScheduling[i+direction];
|
||||
resultScheduling[point2] = tmp;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ using namespace std;
|
|||
// the moeoObjectiveVectorTraits : minimizing 2 objectives
|
||||
class Sch1ObjectiveVectorTraits : public moeoObjectiveVectorTraits
|
||||
{
|
||||
public:static bool minimizing (int i)
|
||||
public:
|
||||
static bool minimizing (int i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue