From 2a102a5cf71dbe389ebff1949b8a2d1c21ebe127 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Tue, 18 May 2010 09:17:13 +0000 Subject: [PATCH] =?UTF-8?q?Dans=20les=20"neighbors":=20Ajout=20d'un=20temp?= =?UTF-8?q?late=20Fitness=20avec=20comme=20valeur=20par=20d=C3=A9faut=20EO?= =?UTF-8?q?T::Fitness.=20Utile=20pour=20la=20compatibilit=C3=A9=20avec=20M?= =?UTF-8?q?OEO=20ou=20Fitness=20doit=20=C3=AAtre=20un=20Objective=20Vector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1816 331e1502-861f-0410-8da2-ba01fb791d7f --- .../src/neighborhood/moBackableNeighbor.h | 4 ++-- .../src/neighborhood/moDummyNeighbor.h | 4 ++-- .../src/neighborhood/moIndexNeighbor.h | 14 +++++++------- trunk/paradiseo-mo/src/neighborhood/moNeighbor.h | 8 ++++---- .../src/problems/permutation/moShiftNeighbor.h | 6 +++--- .../src/problems/permutation/moSwapNeighbor.h | 4 ++-- .../src/problems/permutation/moSwapNeighborhood.h | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) 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