Passage du code dans un pretty printer
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1813 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
cc31901008
commit
3d8057ac4d
88 changed files with 2726 additions and 2720 deletions
|
|
@ -36,19 +36,19 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
* Count the number of move, noMove and the number of successive stagnation since the last Move
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moCountMoveMemory : virtual public moMemory<Neighbor>{
|
||||
class moCountMoveMemory : virtual public moMemory<Neighbor> {
|
||||
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* Init all the counters
|
||||
* @param _sol unused solution
|
||||
*/
|
||||
void init(EOT & _sol) {
|
||||
nbMove=0;
|
||||
nbNoMove=0;
|
||||
counter=0;
|
||||
nbMove=0;
|
||||
nbNoMove=0;
|
||||
counter=0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,8 +56,8 @@ public:
|
|||
* @param _neighbor unused neighbor
|
||||
*/
|
||||
void add(EOT & _sol, Neighbor & _neighbor) {
|
||||
nbMove++;
|
||||
counter=0;
|
||||
nbMove++;
|
||||
counter=0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,48 +65,48 @@ public:
|
|||
* @param _neighbor unused neighbor
|
||||
*/
|
||||
void update(EOT & _sol, Neighbor & _neighbor) {
|
||||
nbNoMove++;
|
||||
counter++;
|
||||
nbNoMove++;
|
||||
counter++;
|
||||
}
|
||||
|
||||
/**
|
||||
* ClearMemory : Reinit all the counters
|
||||
*/
|
||||
void clearMemory() {
|
||||
nbMove=0;
|
||||
nbNoMove=0;
|
||||
counter=0;
|
||||
nbMove=0;
|
||||
nbNoMove=0;
|
||||
counter=0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter of the number of move
|
||||
* @return the counter
|
||||
*/
|
||||
unsigned int getNbMove(){
|
||||
return nbMove;
|
||||
unsigned int getNbMove() {
|
||||
return nbMove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter of the number of no move
|
||||
* @return the counter
|
||||
*/
|
||||
unsigned int getNbNoMove(){
|
||||
return nbNoMove;
|
||||
unsigned int getNbNoMove() {
|
||||
return nbNoMove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter of the number of successive stagnation since the last Move
|
||||
* @return the counter
|
||||
*/
|
||||
unsigned int getCounter(){
|
||||
return counter;
|
||||
unsigned int getCounter() {
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init counter
|
||||
*/
|
||||
void initCounter(){
|
||||
counter=0;
|
||||
void initCounter() {
|
||||
counter=0;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
* Abstract class for diversification strategy
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moDiversification : virtual public moMemory<Neighbor>, public eoUF<typename Neighbor::EOT &,bool>{};
|
||||
class moDiversification : virtual public moMemory<Neighbor>, public eoUF<typename Neighbor::EOT &,bool> {};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
* Dummy memory to make an empty memory
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moDummyMemory : virtual public moMemory<Neighbor>{
|
||||
class moDummyMemory : virtual public moMemory<Neighbor> {
|
||||
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* Init : NOTHIING TO DO
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
* Abstract class for intensification strategy
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moIntensification : virtual public moMemory<Neighbor>, public eoUF<typename Neighbor::EOT &,bool>{};
|
||||
class moIntensification : virtual public moMemory<Neighbor>, public eoUF<typename Neighbor::EOT &,bool> {};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -45,28 +45,28 @@ class moMonOpDiversification : public moDiversification<Neighbor>, public moDumm
|
|||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _monOp an eoMonOp (diversification operator)
|
||||
* @param _fullEval a full evaluation function
|
||||
*/
|
||||
moMonOpDiversification(eoMonOp<EOT>& _monOp, eoEvalFunc<EOT>& _fullEval):monOp(_monOp), fullEval(_fullEval){}
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _monOp an eoMonOp (diversification operator)
|
||||
* @param _fullEval a full evaluation function
|
||||
*/
|
||||
moMonOpDiversification(eoMonOp<EOT>& _monOp, eoEvalFunc<EOT>& _fullEval):monOp(_monOp), fullEval(_fullEval) {}
|
||||
|
||||
/**
|
||||
* Apply monOp on the solution
|
||||
* @param _solution to diversify
|
||||
* @return value of monOp
|
||||
*/
|
||||
bool operator()(EOT& _solution){
|
||||
bool res = monOp(_solution);
|
||||
fullEval(_solution);
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* Apply monOp on the solution
|
||||
* @param _solution to diversify
|
||||
* @return value of monOp
|
||||
*/
|
||||
bool operator()(EOT& _solution) {
|
||||
bool res = monOp(_solution);
|
||||
fullEval(_solution);
|
||||
return res;
|
||||
}
|
||||
|
||||
private:
|
||||
/** monOp */
|
||||
eoMonOp<EOT>& monOp;
|
||||
eoEvalFunc<EOT>& fullEval;
|
||||
/** monOp */
|
||||
eoMonOp<EOT>& monOp;
|
||||
eoEvalFunc<EOT>& fullEval;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -88,10 +88,10 @@ public:
|
|||
* @param _neighbor the current neighbor (unused)
|
||||
*/
|
||||
virtual void update(EOT & _sol, Neighbor & _neighbor) {
|
||||
if(howlong > 0)
|
||||
for (unsigned int i=0; i<tabuList.size(); i++)
|
||||
if(tabuList[i].second > 0)
|
||||
tabuList[i].second--;
|
||||
if (howlong > 0)
|
||||
for (unsigned int i=0; i<tabuList.size(); i++)
|
||||
if (tabuList[i].second > 0)
|
||||
tabuList[i].second--;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -88,10 +88,10 @@ public:
|
|||
* @param _neighbor the current neighbor (unused)
|
||||
*/
|
||||
virtual void update(EOT & _sol, Neighbor & _neighbor) {
|
||||
if(howlong > 0)
|
||||
for (unsigned int i=0; i<tabuList.size(); i++)
|
||||
if(tabuList[i].second > 0)
|
||||
tabuList[i].second--;
|
||||
if (howlong > 0)
|
||||
for (unsigned int i=0; i<tabuList.size(); i++)
|
||||
if (tabuList[i].second > 0)
|
||||
tabuList[i].second--;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue