diff --git a/trunk/paradiseo-mo/src/eval/moDummyEval.h b/trunk/paradiseo-mo/src/eval/moDummyEval.h index 60f487d54..2fa9dfdb5 100644 --- a/trunk/paradiseo-mo/src/eval/moDummyEval.h +++ b/trunk/paradiseo-mo/src/eval/moDummyEval.h @@ -35,17 +35,17 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * Dummy Evaluation function */ -template -class moDummyEval : public moEval{ +template +class moDummyEval : public moEval{ public: - typedef typename N::EOT EOT; + typedef typename Neighbor::EOT EOT; typedef typename EOT::Fitness Fitness; /** * NOTHING TO DO * @param _sol a solution */ - void operator()(EOT& _sol, N& _n){} + void operator()(EOT& _sol, Neighbor& _n){} }; diff --git a/trunk/paradiseo-mo/src/explorer/moILSexplorer.h b/trunk/paradiseo-mo/src/explorer/moILSexplorer.h index 2c4959153..5fbd81ddb 100644 --- a/trunk/paradiseo-mo/src/explorer/moILSexplorer.h +++ b/trunk/paradiseo-mo/src/explorer/moILSexplorer.h @@ -52,7 +52,7 @@ class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor Neighborhood ; - typedef typename Neighbor::EOT EOT ; + typedef typename Neighbor::EOT EOT; typedef moDummyNeighbor dummyNeighbor; typedef moDummyNeighborhood dummyNeighborhood; diff --git a/trunk/paradiseo-mo/src/neighborhood/moBackableNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moBackableNeighbor.h index efeb0acae..4950aa838 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moBackableNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moBackableNeighbor.h @@ -40,8 +40,8 @@ /** * Neighbor with a move back function to use in a moFullEvalByModif */ -template< class EOT , class Fitness > -class moBackableNeighbor : virtual public moNeighbor +template< class EOT > +class moBackableNeighbor : virtual public moNeighbor { public: diff --git a/trunk/paradiseo-mo/src/neighborhood/moBackwardVariableNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moBackwardVariableNeighborhood.h index d9ecdf504..5c8102467 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moBackwardVariableNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moBackwardVariableNeighborhood.h @@ -35,20 +35,20 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * A variable Neighborhood Search (VNS) in the Backward manner */ -template< class EOT, class Fitness > -class moBackwardVariableNeighborhood : public moVariableNeighborhood +template< class EOT > +class moBackwardVariableNeighborhood : public moVariableNeighborhood { public: - typedef moNeighbor Neighbor; + typedef moNeighbor Neighbor; - using moVariableNeighborhood::currentNH; - using moVariableNeighborhood::neighborhoodVector; + using moVariableNeighborhood::currentNH; + using moVariableNeighborhood::neighborhoodVector; /** * Construction of at least one neighborhood * @param _firstNH first neighborhood in the vector */ - moBackwardVariableNeighborhood(moNeighborhood& _firstNH) : moVariableNeighborhood(_firstNH) { } + moBackwardVariableNeighborhood(moNeighborhood& _firstNH) : moVariableNeighborhood(_firstNH) { } /** * Return the class id. diff --git a/trunk/paradiseo-mo/src/neighborhood/moBitNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moBitNeighbor.h index 9ae964c09..778da36d3 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moBitNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moBitNeighbor.h @@ -43,13 +43,13 @@ * Neighbor related to a vector of Bit */ template< class Fitness > -class moBitNeighbor : public moBackableNeighbor, Fitness>, public moIndexNeighbor, Fitness> +class moBitNeighbor : public moBackableNeighbor >, public moIndexNeighbor > { public: typedef eoBit EOT ; - using moBackableNeighbor, Fitness>::fitness; - using moIndexNeighbor, Fitness>::key; + using moBackableNeighbor::fitness; + using moIndexNeighbor::key; /** * move the solution diff --git a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighbor.h index 8f3ee7e42..8e20113d0 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighbor.h @@ -35,8 +35,8 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * Dummy Neighborhood */ -template< class EOT , class Fitness > -class moDummyNeighbor : public moNeighbor< EOT,Fitness>{ +template< class EOT > +class moDummyNeighbor : public moNeighbor< EOT >{ public: /** diff --git a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h index 8094822db..21cb0822a 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighborhood.h @@ -35,10 +35,9 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * Dummy Neighborhood */ -template< class N > -class moDummyNeighborhood : public moNeighborhood{ +template< class Neighbor > +class moDummyNeighborhood : public moNeighborhood{ public: - typedef N Neighbor; typedef typename Neighbor::EOT EOT; /** diff --git a/trunk/paradiseo-mo/src/neighborhood/moForwardVariableNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moForwardVariableNeighborhood.h index 7f9ec6d36..d9e5f7e50 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moForwardVariableNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moForwardVariableNeighborhood.h @@ -35,21 +35,21 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * A variable Neighborhood Search (VNS) in the forward manner */ -template< class EOT, class Fitness > -class moForwardVariableNeighborhood : public moVariableNeighborhood +template< class EOT > +class moForwardVariableNeighborhood : public moVariableNeighborhood { public: - typedef moNeighbor Neighbor; + typedef moNeighbor Neighbor; - using moVariableNeighborhood::currentNH; - using moVariableNeighborhood::neighborhoodVector; + using moVariableNeighborhood::currentNH; + using moVariableNeighborhood::neighborhoodVector; /** * Construction of at least one neighborhood * @param _firstNH first neighborhood in the vector */ - moForwardVariableNeighborhood(moNeighborhood& _firstNH) : moVariableNeighborhood(_firstNH) { } + moForwardVariableNeighborhood(moNeighborhood& _firstNH) : moVariableNeighborhood(_firstNH) { } /** * Return the class id. diff --git a/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h index ef922b089..ecaddea73 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h @@ -40,30 +40,30 @@ /** * Index Neighbor */ -template< class EOT , class Fitness > -class moIndexNeighbor : virtual public moNeighbor +template< class EOT > +class moIndexNeighbor : virtual public moNeighbor { public: - using moNeighbor::fitness; + using moNeighbor::fitness; /** * Default Constructor */ - moIndexNeighbor() : moNeighbor(), key(0) {} + moIndexNeighbor() : moNeighbor(), key(0) {} /** * Copy Constructor */ - moIndexNeighbor(const moIndexNeighbor& _n) : moNeighbor(_n) { + moIndexNeighbor(const moIndexNeighbor& _n) : moNeighbor(_n) { this->key = _n.key ; } /** * Assignment operator */ - virtual moIndexNeighbor & operator=(const moIndexNeighbor & _source) { - moNeighbor::operator=(_source); + virtual moIndexNeighbor & operator=(const moIndexNeighbor & _source) { + moNeighbor::operator=(_source); this->key = _source.key ; return *this ; } diff --git a/trunk/paradiseo-mo/src/neighborhood/moNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moNeighbor.h index 4114ff6ca..76e5dbcdf 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moNeighbor.h @@ -43,11 +43,12 @@ /** * Container of the neighbor informations */ -template< class EOType , class Fitness > +template< class EOType > class moNeighbor : public eoObject, public eoPersistent { public: typedef EOType EOT; + typedef typename EOT::Fitness Fitness; /** * Default Constructor */ @@ -57,7 +58,7 @@ public: * Copy Constructor * @param _neighbor to copy */ - moNeighbor(const moNeighbor& _neighbor) { + moNeighbor(const moNeighbor& _neighbor) { repFitness = _neighbor.fitness(); } @@ -66,7 +67,7 @@ public: * @param _neighbor the neighbor to assign * @return a neighbor equal to the other */ - virtual moNeighbor& operator=(const moNeighbor& _neighbor) { + virtual moNeighbor& operator=(const moNeighbor& _neighbor) { repFitness = _neighbor.fitness(); return (*this); } diff --git a/trunk/paradiseo-mo/src/neighborhood/moOrderNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moOrderNeighborhood.h index b8a7245b8..b7535051a 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moOrderNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moOrderNeighborhood.h @@ -40,21 +40,18 @@ /** * A Ordered Neighborhood */ -template< class N > -class moOrderNeighborhood : public moIndexNeighborhood +template< class Neighbor > +class moOrderNeighborhood : public moIndexNeighborhood { public: /** * Define type of a solution corresponding to Neighbor */ - typedef N Neighbor; typedef typename Neighbor::EOT EOT; - using moIndexNeighborhood::neighborhoodSize; - /** * Constructor * @param _neighborhoodSize the size of the neighborhood diff --git a/trunk/paradiseo-mo/src/neighborhood/moRndWithReplNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moRndWithReplNeighborhood.h index bad901816..b99824658 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moRndWithReplNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moRndWithReplNeighborhood.h @@ -42,18 +42,16 @@ /** * A Random With replacement Neighborhood */ -template< class N > -class moRndWithReplNeighborhood : public moIndexNeighborhood, public moRndNeighborhood +template< class Neighbor > +class moRndWithReplNeighborhood : public moIndexNeighborhood, public moRndNeighborhood { public: /** * Define type of a solution corresponding to Neighbor */ - typedef N Neighbor; typedef typename Neighbor::EOT EOT; - using moIndexNeighborhood::neighborhoodSize; /** diff --git a/trunk/paradiseo-mo/src/neighborhood/moRndWithoutReplNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moRndWithoutReplNeighborhood.h index 89b7586ac..a80f0542c 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moRndWithoutReplNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moRndWithoutReplNeighborhood.h @@ -42,15 +42,14 @@ /** * A Random without replacement Neighborhood */ -template< class N > -class moRndWithoutReplNeighborhood : public moIndexNeighborhood, public moRndNeighborhood +template< class Neighbor > +class moRndWithoutReplNeighborhood : public moIndexNeighborhood, public moRndNeighborhood { public: /** * Define type of a solution corresponding to Neighbor */ - typedef N Neighbor; typedef typename Neighbor::EOT EOT; diff --git a/trunk/paradiseo-mo/src/neighborhood/moVariableNeighborhood.h b/trunk/paradiseo-mo/src/neighborhood/moVariableNeighborhood.h index 4c0016d16..bf4ef2692 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moVariableNeighborhood.h +++ b/trunk/paradiseo-mo/src/neighborhood/moVariableNeighborhood.h @@ -38,12 +38,12 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * A vector of neighborhood for the Variable Neighborhood Search (VNS) */ -template< class EOT, class Fitness > -class moVariableNeighborhood : public moNeighborhood > +template< class EOT > +class moVariableNeighborhood : public moNeighborhood > { public: - typedef moNeighbor Neighbor; + typedef moNeighbor Neighbor; /** * Construction of at least one neighborhood * @param _firstNH first neighborhood in the vector diff --git a/trunk/paradiseo-mo/test/moTestClass.h b/trunk/paradiseo-mo/test/moTestClass.h index 2eea45a33..2b58e60c6 100644 --- a/trunk/paradiseo-mo/test/moTestClass.h +++ b/trunk/paradiseo-mo/test/moTestClass.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -63,12 +64,12 @@ typedef moDummyRndNeighborhood bitNeighborhood ; typedef EO Solution; -class moDummyNeighborTest : public moNeighbor { +class moDummyNeighborTest : public moNeighbor { public: virtual void move(Solution & _solution) {} }; -class moDummyBackableNeighbor : public moBackableNeighbor { +class moDummyBackableNeighbor : public moBackableNeighbor { public: virtual void move(Solution & _solution) {} virtual void moveBack(Solution & _solution) {} diff --git a/trunk/paradiseo-mo/test/t-moForwardVariableNeighborhood.cpp b/trunk/paradiseo-mo/test/t-moForwardVariableNeighborhood.cpp index e91380204..904202d09 100644 --- a/trunk/paradiseo-mo/test/t-moForwardVariableNeighborhood.cpp +++ b/trunk/paradiseo-mo/test/t-moForwardVariableNeighborhood.cpp @@ -42,7 +42,7 @@ int main(){ std::cout << "[t-moForwardVariableNeighborhood] => START" << std::endl; moRndWithoutReplNeighborhood rndNH(8); - moOrderNeighborhood, eoMinimizingFitness> > orderNH(8); + moOrderNeighborhood > >orderNH(8); //moForwardVariableNeighborhood, eoMinimizingFitness> test(orderNH); diff --git a/trunk/paradiseo-mo/tutorial/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/CMakeLists.txt index 2fc13942e..85355a698 100644 --- a/trunk/paradiseo-mo/tutorial/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/CMakeLists.txt @@ -1 +1 @@ -ADD_SUBDIRECTORY(oneMax) \ No newline at end of file +#ADD_SUBDIRECTORY(oneMax) \ No newline at end of file