#ifndef _moMoveNeighbor_h #define _moMoveNeighbor_h #include #include #include #include /* contener of the neighbor informations */ template< class M , class Fitness > class moMoveNeighbor : public moNeighbor { public: typedef typename M::EOType EOT; // empty constructor moMoveNeighbor() { move=new M(); }; ~moMoveNeighbor() { delete move; }; // copy constructeur moMoveNeighbor(const moMoveNeighbor & _n) { moNeighbor::operator=(_n); (*move) = *(_n.getMove()); } // assignment operator virtual moMoveNeighbor & operator=(const moMoveNeighbor & _n) { moNeighbor ::operator=(_n); (*move) = *(_n.getMove()); return *this ; } /* * move the solution */ virtual void move(EOT & _solution) { (*move)(_solution); } /** Return the class id. * @return the class name as a std::string */ virtual std::string className() const { return "moMoveNeighbor"; } void setMove(M* _move) { move=_move; } M* getMove() { return move; } private: M* move; }; #endif