Tests have been included and src code has been updated to avoid compilation warnings

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@937 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jboisson 2008-02-13 10:38:33 +00:00
commit acc73239fb
37 changed files with 2531 additions and 47 deletions

View file

@ -58,7 +58,8 @@ class moBestImprSelect:public moMoveSelect < M >
void init (const Fitness & _fitness)
{
//Code only used to avoid warning because _fitness is not used in this procedure.
Fitness fitness=(Fitness)_fitness;
Fitness fitness;
fitness=(Fitness)_fitness;
first_time = true;
}

View file

@ -66,7 +66,7 @@ class moGenSolContinue:public moSolContinue < EOT >
bool operator () (const EOT & _solution)
{
//code only used for avoiding warning because _sol is not used in this function.
EOT solution=(EOT)_solution;
const EOT solution(_solution);
return (++generationNumber < generationMaximumNumber);
}

View file

@ -53,10 +53,8 @@ class moImprBestFitAspirCrit:public moAspirCrit < M >
typedef typename M::EOType::Fitness Fitness;
//! Contructor
moImprBestFitAspirCrit ()
{
first_time = true;
}
moImprBestFitAspirCrit (): first_time(true)
{}
//! Initialisation procedure
void init ()
@ -74,6 +72,9 @@ class moImprBestFitAspirCrit:public moAspirCrit < M >
*/
bool operator () (const M & _move, const Fitness & _fitness)
{
//code only used for avoiding warning because _move is not used in this function.
const M move(_move);
if (first_time)
{
best_fitness = _fitness;

View file

@ -73,9 +73,9 @@ class moItRandNextMove:public moNextMove < M >
bool operator () (M & _move, const EOT & _solution)
{
//code only used to avoid warning because _solution is not used in this function.
EOT solution=(EOT)_solution;
const EOT solution(_solution);
if (iteration_number++ > iteration_maximum_number)
if (iteration_number > iteration_maximum_number)
{
iteration_number = 0;
return false;

View file

@ -42,8 +42,8 @@
/*!
Only a description...See moMoveLoopExpl.
*/
template < class M > class
moMoveExpl : public eoBF < const typename M::EOType &, typename M::EOType &, void >
template < class M >
class moMoveExpl : public eoBF < const typename M::EOType &, typename M::EOType &, void >
{};
#endif

View file

@ -46,6 +46,8 @@
template < class M >
class moNoAspirCrit:public moAspirCrit < M >
{
public:
//! Function which describes the aspiration criterion behaviour
/*!
Does nothing.
@ -56,6 +58,11 @@ class moNoAspirCrit:public moAspirCrit < M >
*/
bool operator () (const M & _move, const typename M::EOType::Fitness & _fitness)
{
//Code only used to avoid warning because _move and _fitness are not used in this procedure.
const M move(_move);
typename M::EOType::Fitness fitness;
fitness=(typename M::EOType::Fitness)_fitness;
return false;
}

View file

@ -86,7 +86,7 @@ class moSimpleMoveTabuList: public moTabuList < M >
void add(const M & _move, const EOT & _solution)
{
//code only used to avoid warning because _solution is not used in this function.
EOT solution=(EOT)_solution;
const EOT solution(_solution);
if (memory_size!=0)
{

View file

@ -68,10 +68,10 @@ class moSimpleSolutionTabuList: public moTabuList < M >
*/
bool operator () (const M & _move, const EOT & _solution)
{
solutionIterator it;
M move((M)_move);
EOT solution((EOT)_solution);
M move=(M)_move;
EOT solution=(EOT) _solution;
solutionIterator it;
move(solution);