diff --git a/trunk/paradiseo-mo/src/neighborhood/moBackableNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moBackableNeighbor.h index 4950aa838..76bc5493e 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 moBackableNeighbor : virtual public moNeighbor +template< class EOT, class Fitness=typename EOT::Fitness > +class moBackableNeighbor : virtual public moNeighbor { public: diff --git a/trunk/paradiseo-mo/src/neighborhood/moDummyNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moDummyNeighbor.h index 628cf285a..a8cd01087 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 moDummyNeighbor : public moNeighbor< EOT > { +template< class EOT, class Fitness=typename EOT::Fitness > +class moDummyNeighbor : public moNeighbor< EOT, Fitness > { public: /** diff --git a/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h b/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h index 0603c00c1..cf444dadc 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moIndexNeighbor.h @@ -40,23 +40,23 @@ /** * Index Neighbor */ -template< class EOT > -class moIndexNeighbor : virtual public moNeighbor +template< class EOT, class Fitness=typename EOT::Fitness > +class moIndexNeighbor : virtual public moNeighbor { public: - using moNeighbor::fitness; + using moNeighbor::fitness; /** * Default Constructor */ - moIndexNeighbor() : moNeighbor(), key(0) {} + moIndexNeighbor() : moNeighbor(), key(0) {} /** * Copy Constructor * @param _n the neighbor to copy */ - moIndexNeighbor(const moIndexNeighbor& _n) : moNeighbor(_n) { + moIndexNeighbor(const moIndexNeighbor& _n) : moNeighbor(_n) { this->key = _n.key ; } @@ -64,8 +64,8 @@ public: * Assignment operator * @param _source the source neighbor */ - 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 c097a7e5f..7f6accd03 100644 --- a/trunk/paradiseo-mo/src/neighborhood/moNeighbor.h +++ b/trunk/paradiseo-mo/src/neighborhood/moNeighbor.h @@ -43,12 +43,12 @@ /** * Container of the neighbor informations */ -template< class EOType > +template< class EOType, class Fitness=typename EOType::Fitness> class moNeighbor : public eoObject, public eoPersistent { public: typedef EOType EOT; - typedef typename EOT::Fitness Fitness; + /** * Default Constructor */ @@ -58,7 +58,7 @@ public: * Copy Constructor * @param _neighbor to copy */ - moNeighbor(const moNeighbor& _neighbor) { + moNeighbor(const moNeighbor& _neighbor) { repFitness = _neighbor.fitness(); } @@ -67,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/problems/permutation/moShiftNeighbor.h b/trunk/paradiseo-mo/src/problems/permutation/moShiftNeighbor.h index 791918cf9..88d48301d 100644 --- a/trunk/paradiseo-mo/src/problems/permutation/moShiftNeighbor.h +++ b/trunk/paradiseo-mo/src/problems/permutation/moShiftNeighbor.h @@ -35,12 +35,12 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * Indexed Shift Neighbor */ -template -class moShiftNeighbor: public moIndexNeighbor +template +class moShiftNeighbor: public moIndexNeighbor { public: - using moIndexNeighbor::key; + using moIndexNeighbor::key; /** * Apply move on a solution regarding a key diff --git a/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighbor.h b/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighbor.h index 37ef990c9..2846b6f26 100644 --- a/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighbor.h +++ b/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighbor.h @@ -36,8 +36,8 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * Swap Neighbor */ -template -class moSwapNeighbor: public moBackableNeighbor +template +class moSwapNeighbor: public moBackableNeighbor { public: diff --git a/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighborhood.h b/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighborhood.h index b7ea59984..5b573954a 100644 --- a/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighborhood.h +++ b/trunk/paradiseo-mo/src/problems/permutation/moSwapNeighborhood.h @@ -36,11 +36,11 @@ Contact: paradiseo-help@lists.gforge.inria.fr /** * Swap Neighborhood */ -template -class moSwapNeighborhood : public moNeighborhood > +template +class moSwapNeighborhood : public moNeighborhood > { public: - typedef moSwapNeighbor Neighbor; + typedef moSwapNeighbor Neighbor; /** * @return if there are available Neighbor