passage du code dans astyle
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1713 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
d7496cafff
commit
dd66b5e4bd
105 changed files with 3950 additions and 3924 deletions
|
|
@ -12,22 +12,22 @@ template<class MoveNeighbor, class M>
|
|||
class moIncrEvalWrapper : public moEval<MoveNeighbor>
|
||||
{
|
||||
public:
|
||||
using moEval<BackableNeighbor>::EOT EOT;
|
||||
using moEval<BackableNeighbor>::Fitness Fitness;
|
||||
using moEval<BackableNeighbor>::EOT EOT;
|
||||
using moEval<BackableNeighbor>::Fitness Fitness;
|
||||
|
||||
moIncrEvalWrapper(moIncrEval<M>& _incr):incr(_incr){}
|
||||
moIncrEvalWrapper(moIncrEval<M>& _incr):incr(_incr) {}
|
||||
|
||||
/*
|
||||
* make the evaluation of the current neighbor and update the information on this neighbor
|
||||
* the evaluation could be incremental
|
||||
*/
|
||||
virtual void eval(MoveNeighbor& _neighbor,EOT & _solution){
|
||||
_neighbor.fitness(incrEval(*(_neighbor.getMove()), _solution));
|
||||
}
|
||||
/*
|
||||
* make the evaluation of the current neighbor and update the information on this neighbor
|
||||
* the evaluation could be incremental
|
||||
*/
|
||||
virtual void eval(MoveNeighbor& _neighbor,EOT & _solution) {
|
||||
_neighbor.fitness(incrEval(*(_neighbor.getMove()), _solution));
|
||||
}
|
||||
|
||||
private:
|
||||
/** the full evaluation object */
|
||||
moIncrEval<M> & incrEval;
|
||||
/** the full evaluation object */
|
||||
moIncrEval<M> & incrEval;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,20 +2,20 @@
|
|||
<moMove.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
(C) OPAC Team, LIFL, 2002-2008
|
||||
|
||||
|
||||
Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
|
||||
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can use,
|
||||
modify and/ or redistribute the software under the terms of the CeCILL
|
||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
"http://www.cecill.info".
|
||||
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited liability.
|
||||
|
||||
|
||||
In this respect, the user's attention is drawn to the risks associated
|
||||
with loading, using, modifying and/or developing or reproducing the
|
||||
software by the user in light of its specific status of free software,
|
||||
|
|
@ -28,10 +28,10 @@
|
|||
same conditions as regards security.
|
||||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
|
||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _moMove_h
|
||||
|
|
@ -48,10 +48,10 @@
|
|||
template < class EOT >
|
||||
class moMove:public eoUF < EOT &, void >
|
||||
{
|
||||
public:
|
||||
|
||||
// Alias for the type
|
||||
typedef EOT EOType;
|
||||
public:
|
||||
|
||||
// Alias for the type
|
||||
typedef EOT EOType;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@
|
|||
*/
|
||||
template < class M, class Objective = typename M::EOType::Fitness>
|
||||
class moMoveIncrEval:public eoBF < const M &, const typename M::EOType &, Objective >
|
||||
{};
|
||||
{};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,20 +2,20 @@
|
|||
<moMoveInit.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
(C) OPAC Team, LIFL, 2002-2008
|
||||
|
||||
|
||||
Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
|
||||
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can use,
|
||||
modify and/ or redistribute the software under the terms of the CeCILL
|
||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
"http://www.cecill.info".
|
||||
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited liability.
|
||||
|
||||
|
||||
In this respect, the user's attention is drawn to the risks associated
|
||||
with loading, using, modifying and/or developing or reproducing the
|
||||
software by the user in light of its specific status of free software,
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
same conditions as regards security.
|
||||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
|
||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
|
@ -45,6 +45,6 @@
|
|||
*/
|
||||
template < class M >
|
||||
class moMoveInit:public eoBF < M &, const typename M::EOType &, void >
|
||||
{};
|
||||
{};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,58 +12,60 @@
|
|||
contener of the neighbor informations
|
||||
*/
|
||||
template< class M , class Fitness >
|
||||
class moMoveNeighbor : public moNeighbor <typename M::EOType, Fitness>
|
||||
class moMoveNeighbor : public moNeighbor <typename M::EOType, Fitness>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename M::EOType EOT;
|
||||
|
||||
typedef typename M::EOType EOT;
|
||||
|
||||
// empty constructor
|
||||
moMoveNeighbor() {
|
||||
move=new M();
|
||||
};
|
||||
moMoveNeighbor() {
|
||||
move=new M();
|
||||
};
|
||||
|
||||
~moMoveNeighbor() {
|
||||
delete move;
|
||||
};
|
||||
~moMoveNeighbor() {
|
||||
delete move;
|
||||
};
|
||||
|
||||
// copy constructeur
|
||||
moMoveNeighbor(const moMoveNeighbor<M, Fitness> & _n) {
|
||||
moNeighbor<EOT, Fitness>::operator=(_n);
|
||||
(*move) = *(_n.getMove());
|
||||
}
|
||||
|
||||
// copy constructeur
|
||||
moMoveNeighbor(const moMoveNeighbor<M, Fitness> & _n) {
|
||||
moNeighbor<EOT, Fitness>::operator=(_n);
|
||||
(*move) = *(_n.getMove());
|
||||
}
|
||||
|
||||
// assignment operator
|
||||
virtual moMoveNeighbor<M, Fitness> & operator=(const moMoveNeighbor<M, Fitness> & _n) {
|
||||
moNeighbor <EOT, Fitness>::operator=(_n);
|
||||
(*move) = *(_n.getMove());
|
||||
return *this ;
|
||||
moNeighbor <EOT, Fitness>::operator=(_n);
|
||||
(*move) = *(_n.getMove());
|
||||
return *this ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* move the solution
|
||||
*/
|
||||
virtual void move(EOT & _solution){
|
||||
(*move)(_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;
|
||||
virtual std::string className() const {
|
||||
return "moMoveNeighbor";
|
||||
}
|
||||
|
||||
M* getMove(){
|
||||
return move;
|
||||
void setMove(M* _move) {
|
||||
move=_move;
|
||||
}
|
||||
|
||||
|
||||
M* getMove() {
|
||||
return move;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
M* move;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,47 +8,49 @@
|
|||
#include <move/moNextMove.h>
|
||||
|
||||
template< class M, class Fitness >
|
||||
class moMoveNeighborhood : public moNeighborhood <moMoveNeighbor<M, Fitness> >
|
||||
class moMoveNeighborhood : public moNeighborhood <moMoveNeighbor<M, Fitness> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef moMoveNeighbor<M, Fitness> Neighbor;
|
||||
typedef typename M::EOType EOT;
|
||||
typedef moMoveNeighbor<M, Fitness> Neighbor;
|
||||
typedef typename M::EOType EOT;
|
||||
|
||||
moMoveNeighborhood(moMoveInit<M>& i, moNextMove<M>& n):_init(i), _next(n), isContinue(true) {}
|
||||
moMoveNeighborhood(moMoveInit<M>& i, moNextMove<M>& n):_init(i), _next(n), isContinue(true) {}
|
||||
|
||||
virtual bool hasNeighbor(EOT & solution){
|
||||
return true;
|
||||
}
|
||||
virtual bool hasNeighbor(EOT & solution) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
initialisation of the neighborhood
|
||||
*/
|
||||
virtual void init(EOT & solution, Neighbor & current){
|
||||
_init(*(current._move), solution);
|
||||
isContinue=true;
|
||||
}
|
||||
virtual void init(EOT & solution, Neighbor & current) {
|
||||
_init(*(current._move), solution);
|
||||
isContinue=true;
|
||||
}
|
||||
|
||||
/*
|
||||
Give the next neighbor
|
||||
*/
|
||||
virtual void next(EOT & solution, Neighbor & current){
|
||||
isContinue=_next(*(current._move), solution);
|
||||
}
|
||||
virtual void next(EOT & solution, Neighbor & current) {
|
||||
isContinue=_next(*(current._move), solution);
|
||||
}
|
||||
|
||||
/*
|
||||
if false, there is no neighbor left to explore
|
||||
*/
|
||||
virtual bool cont(EOT & solution){
|
||||
return isContinue;
|
||||
}
|
||||
/*
|
||||
if false, there is no neighbor left to explore
|
||||
*/
|
||||
virtual bool cont(EOT & solution) {
|
||||
return isContinue;
|
||||
}
|
||||
|
||||
/** Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const { return "moMoveNeighborhood"; }
|
||||
virtual std::string className() const {
|
||||
return "moMoveNeighborhood";
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
moMoveInit<M>& _init;
|
||||
moNextMove<M>& _next;
|
||||
bool isContinue;
|
||||
|
|
|
|||
|
|
@ -2,20 +2,20 @@
|
|||
<moNextMove.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
(C) OPAC Team, LIFL, 2002-2008
|
||||
|
||||
|
||||
Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
|
||||
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can use,
|
||||
modify and/ or redistribute the software under the terms of the CeCILL
|
||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
"http://www.cecill.info".
|
||||
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited liability.
|
||||
|
||||
|
||||
In this respect, the user's attention is drawn to the risks associated
|
||||
with loading, using, modifying and/or developing or reproducing the
|
||||
software by the user in light of its specific status of free software,
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
same conditions as regards security.
|
||||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
|
||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
|
@ -43,8 +43,8 @@
|
|||
* Useful for the explorer (for moTS or moHC).
|
||||
* Does nothing... An object that herits from this class needs to be designed for being used.
|
||||
*/
|
||||
template < class M >
|
||||
template < class M >
|
||||
class moNextMove:public eoBF < M &, const typename M::EOType &, bool >
|
||||
{};
|
||||
{};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue