DMLS intégré et testé
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1817 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
2a102a5cf7
commit
6720152ff7
24 changed files with 1977 additions and 29 deletions
|
|
@ -72,7 +72,7 @@ SET (TEST_LIST
|
|||
t-moeoDetArchiveSelect
|
||||
t-moeoASEEA
|
||||
#t-moeoEpsilonHyperboxArchive
|
||||
t-moeoQuadTreeIndex
|
||||
#t-moeoQuadTreeIndex
|
||||
t-moeoQuickUnboundedArchiveIndex
|
||||
t-moeoAggregationFitnessAssignment
|
||||
t-moeoConstraintFitnessAssignment
|
||||
|
|
@ -94,6 +94,15 @@ SET (TEST_LIST
|
|||
t-moeoFixedTimeBothDirectionWeightStrategy
|
||||
t-moeoDichoWeightStrategy
|
||||
t-moeoExhaustiveNeighborhoodExplorer
|
||||
t-moeoFirstImprovingNeighborhoodExplorer
|
||||
t-moeoSimpleSubNeighborhoodExplorer
|
||||
t-moeoNoDesimprovingNeighborhoodExplorer
|
||||
t-moeoPLS1
|
||||
t-moeoPLS2
|
||||
t-moeoExhaustiveUnvisitedSelect
|
||||
t-moeoNumberUnvisitedSelect
|
||||
t-moeoDMLSMonOp
|
||||
t-moeoDMLSGenUpdater
|
||||
)
|
||||
|
||||
FOREACH (test ${TEST_LIST})
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
#include <ga/eoBit.h>
|
||||
#include <eoScalarFitness.h>
|
||||
#include <neighborhood/moOrderNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
|
||||
class ObjectiveVectorTraits : public moeoObjectiveVectorTraits
|
||||
{
|
||||
|
|
@ -85,24 +85,74 @@ class evalSolution : public moEval< SolNeighbor >
|
|||
{
|
||||
private:
|
||||
unsigned size;
|
||||
int flag;
|
||||
|
||||
public:
|
||||
evalSolution(unsigned _size) : size(_size) {};
|
||||
evalSolution(unsigned _size, int _flag=1) : size(_size), flag(_flag) {};
|
||||
|
||||
~evalSolution(void) {} ;
|
||||
|
||||
void operator() (Solution& _sol, SolNeighbor& _n){
|
||||
ObjectiveVector objVec=_sol.objectiveVector();
|
||||
if (_sol[_n.index()]){
|
||||
objVec[0]--;
|
||||
objVec[1]++;
|
||||
}
|
||||
else{
|
||||
objVec[0]++;
|
||||
objVec[1]--;
|
||||
}
|
||||
_n.fitness(objVec);
|
||||
if(flag>0){
|
||||
if (_sol[_n.index()]){
|
||||
objVec[0]--;
|
||||
objVec[1]++;
|
||||
}
|
||||
else{
|
||||
objVec[0]++;
|
||||
objVec[1]--;
|
||||
}
|
||||
_n.fitness(objVec);
|
||||
}
|
||||
else if(flag==0){
|
||||
if (_sol[_n.index()]){
|
||||
objVec[0]--;
|
||||
objVec[1]--;
|
||||
}
|
||||
else{
|
||||
objVec[0]++;
|
||||
objVec[1]--;
|
||||
}
|
||||
_n.fitness(objVec);
|
||||
}
|
||||
else{
|
||||
if (_sol[_n.index()]){
|
||||
objVec[0]++;
|
||||
objVec[1]++;
|
||||
}
|
||||
else{
|
||||
objVec[0]++;
|
||||
objVec[1]--;
|
||||
}
|
||||
_n.fitness(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class fullEvalSolution : public eoEvalFunc< Solution >
|
||||
{
|
||||
private:
|
||||
unsigned size;
|
||||
|
||||
public:
|
||||
fullEvalSolution(unsigned _size) : size(_size){};
|
||||
|
||||
~fullEvalSolution(void) {} ;
|
||||
|
||||
void operator() (Solution& _sol){
|
||||
ObjectiveVector o;
|
||||
for(unsigned int i=0; i<size; i++)
|
||||
if(_sol[i])
|
||||
o[0]++;
|
||||
else
|
||||
o[1]++;
|
||||
_sol.objectiveVector(o);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
106
trunk/paradiseo-moeo/test/t-moeoDMLSGenUpdater.cpp
Normal file
106
trunk/paradiseo-moeo/test/t-moeoDMLSGenUpdater.cpp
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
<t-moeoDMLSGenUpdater.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <algo/moeoPLS1.h>
|
||||
#include <eoTimeContinue.h>
|
||||
#include <archive/moeoUnboundedArchive.h>
|
||||
#include <hybridization/moeoDMLSGenUpdater.h>
|
||||
#include <selection/moeoExhaustiveUnvisitedSelect.h>
|
||||
#include <explorer/moeoExhaustiveNeighborhoodExplorer.h>
|
||||
#include <eoGenContinue.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoDMLSGenUpdater] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
moeoUnboundedArchive<Solution> arch(false);
|
||||
moeoUnboundedArchive<Solution> globalArch(false);
|
||||
eoTimeContinue<Solution> cont(1);
|
||||
fullEvalSolution fullEval(8);
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoPLS1<SolNeighbor> pls1(cont, fullEval, arch, nh, eval);
|
||||
moeoExhaustiveUnvisitedSelect<Solution> select;
|
||||
moeoExhaustiveNeighborhoodExplorer<SolNeighbor> explorer(nh, eval);
|
||||
eoGenContinue<Solution> genCont(2);
|
||||
|
||||
//Create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//Set its objective Vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
globalArch(s);
|
||||
assert(globalArch.size()==1);
|
||||
|
||||
//test constructor 1 with a dmls, its archive, a global archive and a generational continuator
|
||||
moeoDMLSGenUpdater<SolNeighbor> test1(pls1, arch, globalArch, genCont);
|
||||
|
||||
//test constructor 2 with a full evaluation function, an explorer, a selector, a global archive and a generational continuator
|
||||
moeoDMLSGenUpdater<SolNeighbor> test2(fullEval, explorer, select, globalArch, genCont);
|
||||
|
||||
//test constructor 3 with a full evaluation function, an explorer, a selector, a global archive and a generational continuator
|
||||
moeoDMLSGenUpdater<SolNeighbor> test3(fullEval, arch, explorer, select, globalArch, genCont);
|
||||
|
||||
std::cout << "initial solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
test1();
|
||||
assert(globalArch.size()==1);
|
||||
test1();
|
||||
assert(globalArch.size()==9);
|
||||
|
||||
std::cout << "global arch:" << std::endl;
|
||||
for(unsigned int i=0; i<globalArch.size(); i++)
|
||||
std::cout << globalArch[i] << std::endl;
|
||||
|
||||
|
||||
std::cout << "[t-moeoDMLSGenUpdater] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
95
trunk/paradiseo-moeo/test/t-moeoDMLSMonOp.cpp
Normal file
95
trunk/paradiseo-moeo/test/t-moeoDMLSMonOp.cpp
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
<t-moeoDMLSMonOp.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <algo/moeoPLS1.h>
|
||||
#include <eoTimeContinue.h>
|
||||
#include <archive/moeoUnboundedArchive.h>
|
||||
#include <hybridization/moeoDMLSMonOp.h>
|
||||
#include <selection/moeoExhaustiveUnvisitedSelect.h>
|
||||
#include <explorer/moeoExhaustiveNeighborhoodExplorer.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoDMLSMonOp] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
moeoUnboundedArchive<Solution> arch(false);
|
||||
eoTimeContinue<Solution> cont(1);
|
||||
fullEvalSolution fullEval(8);
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoPLS1<SolNeighbor> pls1(cont, fullEval, arch, nh, eval);
|
||||
moeoExhaustiveUnvisitedSelect<Solution> select;
|
||||
moeoExhaustiveNeighborhoodExplorer<SolNeighbor> explorer(nh, eval);
|
||||
|
||||
//Create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//Set its objective Vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
//test constructor 1 with a dmls and its archive
|
||||
moeoDMLSMonOp<SolNeighbor> test1(pls1, arch);
|
||||
|
||||
//test constructor 2 with an incremental evaluation function, a selector and an explorer
|
||||
moeoDMLSMonOp<SolNeighbor> test2(fullEval, explorer, select, 2, true);
|
||||
|
||||
//test constructor 3 with an incremental evaluation function, a selector and an explorer and the dmls archive
|
||||
moeoDMLSMonOp<SolNeighbor> test3(fullEval, arch, explorer, select, 2, true);
|
||||
|
||||
std::cout << "initial solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
test1(s);
|
||||
|
||||
std::cout << "mutate solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
std::cout << "[t-moeoDMLSMonOp] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<t-moeoExhaustiveNeighborhoodExplorer.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
|
|
@ -36,17 +36,23 @@ int main(){
|
|||
|
||||
std::cout << "[t-moeoExhaustiveNeighborhoodExplorer] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoExhaustiveNeighborhoodExplorer<SolNeighborhood> explorer(nh, eval);
|
||||
moeoExhaustiveNeighborhoodExplorer<SolNeighbor> explorer(nh, eval);
|
||||
|
||||
//create source and destination population
|
||||
eoPop<Solution> src;
|
||||
eoPop<Solution> dest;
|
||||
|
||||
//create a vector for selection
|
||||
std::vector<unsigned int> v;
|
||||
v.push_back(0);
|
||||
|
||||
//create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
|
@ -56,21 +62,49 @@ int main(){
|
|||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//set its objective vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
// aplly a move on th solution
|
||||
n.index(3);
|
||||
eval(s,n);
|
||||
n.move(s);
|
||||
s.objectiveVector(n.fitness());
|
||||
|
||||
//print initial sol
|
||||
std::cout << "solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
//copy the solution in the source population
|
||||
src.push_back(s);
|
||||
|
||||
//test the explorer
|
||||
explorer(src, v, dest);
|
||||
|
||||
//verify the destination population
|
||||
assert(dest.size()==8);
|
||||
|
||||
assert(dest[0].objectiveVector()[0]==6);
|
||||
assert(dest[1].objectiveVector()[0]==6);
|
||||
assert(dest[2].objectiveVector()[0]==6);
|
||||
assert(dest[3].objectiveVector()[0]==8);
|
||||
assert(dest[4].objectiveVector()[0]==6);
|
||||
assert(dest[5].objectiveVector()[0]==6);
|
||||
assert(dest[6].objectiveVector()[0]==6);
|
||||
assert(dest[7].objectiveVector()[0]==6);
|
||||
|
||||
assert(dest[0].objectiveVector()[1]==2);
|
||||
assert(dest[1].objectiveVector()[1]==2);
|
||||
assert(dest[2].objectiveVector()[1]==2);
|
||||
assert(dest[3].objectiveVector()[1]==0);
|
||||
assert(dest[4].objectiveVector()[1]==2);
|
||||
assert(dest[5].objectiveVector()[1]==2);
|
||||
assert(dest[6].objectiveVector()[1]==2);
|
||||
assert(dest[7].objectiveVector()[1]==2);
|
||||
|
||||
std::cout << "destination:" << std::endl;
|
||||
for(unsigned int i=0; i<dest.size(); i++)
|
||||
std::cout << dest[i] << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
<t-moeoExhaustiveUnvisitedSelect.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include <selection/moeoExhaustiveUnvisitedSelect.h>
|
||||
#include <moeoTestClass.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoExhaustiveUnvisitedSelect] => START" << std::endl;
|
||||
|
||||
// objective vectors
|
||||
eoPop < Solution > pop;
|
||||
pop.resize(5);
|
||||
pop[0].flag(1);
|
||||
pop[1].flag(0);
|
||||
pop[2].flag(0);
|
||||
pop[3].flag(1);
|
||||
pop[4].flag(0);
|
||||
|
||||
moeoExhaustiveUnvisitedSelect < Solution > select;
|
||||
|
||||
std::vector <unsigned int> res;
|
||||
|
||||
res=select(pop);
|
||||
assert(res.size()==3);
|
||||
assert(res[0]==1);
|
||||
assert(res[1]==2);
|
||||
assert(res[2]==4);
|
||||
|
||||
std::cout << "[t-moeoExhaustiveUnvisitedSelect] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
<t-moeoFirstImprovingNeighborhoodExplorer.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <explorer/moeoFirstImprovingNeighborhoodExplorer.h>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoFirstImprovingNeighborhoodExplorer] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
evalSolution eval2(8, 0);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoFirstImprovingNeighborhoodExplorer<SolNeighbor> explorer(nh, eval);
|
||||
moeoFirstImprovingNeighborhoodExplorer<SolNeighbor> explorer2(nh, eval2);
|
||||
|
||||
//create source and destination population
|
||||
eoPop<Solution> src;
|
||||
eoPop<Solution> dest;
|
||||
|
||||
//create a vector for selection
|
||||
std::vector<unsigned int> v;
|
||||
v.push_back(0);
|
||||
|
||||
//create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//set its objective vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
// aplly a move on th solution
|
||||
n.index(3);
|
||||
eval(s,n);
|
||||
n.move(s);
|
||||
s.objectiveVector(n.fitness());
|
||||
|
||||
//print initial sol
|
||||
std::cout << "solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
//copy the solution in the source population
|
||||
src.push_back(s);
|
||||
|
||||
//test the explorer
|
||||
explorer(src, v, dest);
|
||||
|
||||
assert(dest.size()==8);
|
||||
assert(dest[0].objectiveVector()[0]==6);
|
||||
assert(dest[1].objectiveVector()[0]==6);
|
||||
assert(dest[2].objectiveVector()[0]==6);
|
||||
assert(dest[3].objectiveVector()[0]==8);
|
||||
assert(dest[4].objectiveVector()[0]==6);
|
||||
assert(dest[5].objectiveVector()[0]==6);
|
||||
assert(dest[6].objectiveVector()[0]==6);
|
||||
assert(dest[7].objectiveVector()[0]==6);
|
||||
|
||||
assert(dest[0].objectiveVector()[1]==2);
|
||||
assert(dest[1].objectiveVector()[1]==2);
|
||||
assert(dest[2].objectiveVector()[1]==2);
|
||||
assert(dest[3].objectiveVector()[1]==0);
|
||||
assert(dest[4].objectiveVector()[1]==2);
|
||||
assert(dest[5].objectiveVector()[1]==2);
|
||||
assert(dest[6].objectiveVector()[1]==2);
|
||||
assert(dest[7].objectiveVector()[1]==2);
|
||||
|
||||
std::cout << "destination:" << std::endl;
|
||||
for(unsigned int i=0; i<dest.size(); i++)
|
||||
std::cout << dest[i] << std::endl;
|
||||
|
||||
//test explorer2 (eval function is changed to have solutions dominates other ones
|
||||
explorer2(dest, v, src);
|
||||
|
||||
assert(src.size()==3);
|
||||
|
||||
assert(src[1].objectiveVector()[0]==7);
|
||||
assert(src[2].objectiveVector()[0]==5);
|
||||
|
||||
assert(src[1].objectiveVector()[1]==1);
|
||||
assert(src[2].objectiveVector()[1]==1);
|
||||
|
||||
std::cout << "source: (after an exploration dest -> src)" << std::endl;
|
||||
for(unsigned int i=0; i<src.size(); i++)
|
||||
std::cout << src[i] << std::endl;
|
||||
|
||||
|
||||
std::cout << "[t-moeoFirstImprovingNeighborhoodExplorer] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
<t-moeoNoDesimprovingNeighborhoodExplorer.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <explorer/moeoNoDesimprovingNeighborhoodExplorer.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoNoDesimprovingNeighborhoodExplorer] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
Solution s;
|
||||
evalSolution eval(8, -1);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoNoDesimprovingNeighborhoodExplorer<SolNeighbor> explorer(nh, eval);
|
||||
|
||||
//create source and destination population
|
||||
eoPop<Solution> src;
|
||||
eoPop<Solution> dest;
|
||||
|
||||
//create a vector for selection
|
||||
std::vector<unsigned int> v;
|
||||
v.push_back(0);
|
||||
|
||||
//create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//set its objective vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
// aplly a move on th solution
|
||||
n.index(3);
|
||||
eval(s,n);
|
||||
n.move(s);
|
||||
s.objectiveVector(n.fitness());
|
||||
|
||||
//print initial sol
|
||||
std::cout << "solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
//copy the solution in the source population
|
||||
src.push_back(s);
|
||||
|
||||
//test explorer, the evaluation function is adapt to test this explorer
|
||||
explorer(src, v, dest);
|
||||
|
||||
//verify destination population
|
||||
assert(dest.size()==1);
|
||||
assert(dest[0].objectiveVector()[0]==10);
|
||||
assert(dest[0].objectiveVector()[1]==0);
|
||||
|
||||
std::cout << "destination:" << std::endl;
|
||||
for(unsigned int i=0; i<dest.size(); i++)
|
||||
std::cout << dest[i] << std::endl;
|
||||
|
||||
std::cout << "[t-moeoNoDesimprovingNeighborhoodExplorer] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
83
trunk/paradiseo-moeo/test/t-moeoNumberUnvisitedSelect.cpp
Normal file
83
trunk/paradiseo-moeo/test/t-moeoNumberUnvisitedSelect.cpp
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
<t-moeoNumberUnvisitedSelect.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include <selection/moeoNumberUnvisitedSelect.h>
|
||||
#include <moeoTestClass.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoNumberUnvisitedSelect] => START" << std::endl;
|
||||
|
||||
// objective vectors
|
||||
eoPop < Solution > pop;
|
||||
pop.resize(5);
|
||||
pop[0].flag(1);
|
||||
pop[1].flag(0);
|
||||
pop[2].flag(0);
|
||||
pop[3].flag(1);
|
||||
pop[4].flag(0);
|
||||
|
||||
moeoNumberUnvisitedSelect < Solution > select(2);
|
||||
|
||||
std::vector <unsigned int> res;
|
||||
|
||||
//test general
|
||||
res=select(pop);
|
||||
assert(res.size()==2);
|
||||
assert(res[0]==1 || res[0]==2 || res[0]==4);
|
||||
assert(res[1]==1 || res[1]==2 || res[1]==4);
|
||||
assert(res[0] != res[1]);
|
||||
|
||||
//test au bornes
|
||||
moeoNumberUnvisitedSelect < Solution > select2(6);
|
||||
res.resize(0);
|
||||
res=select2(pop);
|
||||
assert(res.size()==3);
|
||||
assert(res[0]==1 || res[0]==2 || res[0]==4);
|
||||
assert(res[1]==1 || res[1]==2 || res[1]==4);
|
||||
assert(res[2]==1 || res[2]==2 || res[2]==4);
|
||||
assert(res[0] != res[1]);
|
||||
assert(res[0] != res[2]);
|
||||
assert(res[1] != res[2]);
|
||||
|
||||
moeoNumberUnvisitedSelect < Solution > select3(0);
|
||||
res.resize(0);
|
||||
res=select3(pop);
|
||||
assert(res.size()==0);
|
||||
|
||||
|
||||
std::cout << "[t-moeoNumberUnvisitedSelect] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
118
trunk/paradiseo-moeo/test/t-moeoPLS1.cpp
Normal file
118
trunk/paradiseo-moeo/test/t-moeoPLS1.cpp
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
<t-moeoPLS1.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <algo/moeoPLS1.h>
|
||||
#include <eoTimeContinue.h>
|
||||
#include <archive/moeoUnboundedArchive.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoPLS1] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
moeoUnboundedArchive<Solution> arch(false);
|
||||
eoTimeContinue<Solution> cont(1);
|
||||
fullEvalSolution fullEval(8);
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoPLS1<SolNeighbor> test(cont, fullEval, arch, nh, eval);
|
||||
|
||||
//create source population
|
||||
eoPop<Solution> src;
|
||||
|
||||
//Create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//Set its objective Vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
//apply a move on the solution and compute new objective vector
|
||||
n.index(3);
|
||||
eval(s,n);
|
||||
n.move(s);
|
||||
s.objectiveVector(n.fitness());
|
||||
|
||||
//copy the solution in the source population
|
||||
src.push_back(s);
|
||||
|
||||
//test PLS1
|
||||
test(src);
|
||||
|
||||
//verify all objective vector was found.
|
||||
assert(arch.size()==9);
|
||||
assert(arch[0].objectiveVector()[0]==7);
|
||||
assert(arch[1].objectiveVector()[0]==6);
|
||||
assert(arch[2].objectiveVector()[0]==8);
|
||||
assert(arch[3].objectiveVector()[0]==5);
|
||||
assert(arch[4].objectiveVector()[0]==4);
|
||||
assert(arch[5].objectiveVector()[0]==3);
|
||||
assert(arch[6].objectiveVector()[0]==2);
|
||||
assert(arch[7].objectiveVector()[0]==1);
|
||||
assert(arch[8].objectiveVector()[0]==0);
|
||||
|
||||
assert(arch[0].objectiveVector()[1]==1);
|
||||
assert(arch[1].objectiveVector()[1]==2);
|
||||
assert(arch[2].objectiveVector()[1]==0);
|
||||
assert(arch[3].objectiveVector()[1]==3);
|
||||
assert(arch[4].objectiveVector()[1]==4);
|
||||
assert(arch[5].objectiveVector()[1]==5);
|
||||
assert(arch[6].objectiveVector()[1]==6);
|
||||
assert(arch[7].objectiveVector()[1]==7);
|
||||
assert(arch[8].objectiveVector()[1]==8);
|
||||
|
||||
//Print
|
||||
std::cout << "source:" << std::endl;
|
||||
std::cout << src << std::endl;
|
||||
|
||||
std::cout << "archive:" << std::endl;
|
||||
for(unsigned int i=0; i<arch.size(); i++)
|
||||
std::cout << arch[i] << std::endl;
|
||||
|
||||
std::cout << "[t-moeoPLS1] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
119
trunk/paradiseo-moeo/test/t-moeoPLS2.cpp
Normal file
119
trunk/paradiseo-moeo/test/t-moeoPLS2.cpp
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
<t-moeoPLS2.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <algo/moeoPLS2.h>
|
||||
#include <eoTimeContinue.h>
|
||||
#include <archive/moeoUnboundedArchive.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoPLS2] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
moeoUnboundedArchive<Solution> arch(false);
|
||||
eoTimeContinue<Solution> cont(1);
|
||||
fullEvalSolution fullEval(8);
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoPLS2<SolNeighbor> test(cont, fullEval, arch, nh, eval);
|
||||
|
||||
//create source population
|
||||
eoPop<Solution> src;
|
||||
|
||||
//Create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//Set its objective Vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
//apply a move on the solution and compute new objective vector
|
||||
n.index(3);
|
||||
eval(s,n);
|
||||
n.move(s);
|
||||
s.objectiveVector(n.fitness());
|
||||
|
||||
//copy the solution in the source population
|
||||
src.push_back(s);
|
||||
|
||||
//test PLS2
|
||||
test(src);
|
||||
|
||||
//verify all objective vector was found.
|
||||
assert(arch.size()==9);
|
||||
assert(arch[0].objectiveVector()[0]==7);
|
||||
assert(arch[1].objectiveVector()[0]==6);
|
||||
assert(arch[2].objectiveVector()[0]==8);
|
||||
assert(arch[3].objectiveVector()[0]==5);
|
||||
assert(arch[4].objectiveVector()[0]==4);
|
||||
assert(arch[5].objectiveVector()[0]==3);
|
||||
assert(arch[6].objectiveVector()[0]==2);
|
||||
assert(arch[7].objectiveVector()[0]==1);
|
||||
assert(arch[8].objectiveVector()[0]==0);
|
||||
|
||||
assert(arch[0].objectiveVector()[1]==1);
|
||||
assert(arch[1].objectiveVector()[1]==2);
|
||||
assert(arch[2].objectiveVector()[1]==0);
|
||||
assert(arch[3].objectiveVector()[1]==3);
|
||||
assert(arch[4].objectiveVector()[1]==4);
|
||||
assert(arch[5].objectiveVector()[1]==5);
|
||||
assert(arch[6].objectiveVector()[1]==6);
|
||||
assert(arch[7].objectiveVector()[1]==7);
|
||||
assert(arch[8].objectiveVector()[1]==8);
|
||||
|
||||
//Print
|
||||
std::cout << "source:" << std::endl;
|
||||
std::cout << src << std::endl;
|
||||
|
||||
std::cout << "archive:" << std::endl;
|
||||
for(unsigned int i=0; i<arch.size(); i++)
|
||||
std::cout << arch[i] << std::endl;
|
||||
|
||||
|
||||
std::cout << "[t-moeoPLS2] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
<t-moeoSimpleSubNeighborhoodExplorer.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
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
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "moeoTestClass.h"
|
||||
#include <explorer/moeoSimpleSubNeighborhoodExplorer.h>
|
||||
|
||||
int main(){
|
||||
|
||||
std::cout << "[t-moeoSimpleSubNeighborhoodExplorer] => START" << std::endl;
|
||||
|
||||
//init all components
|
||||
Solution s;
|
||||
evalSolution eval(8);
|
||||
ObjectiveVector o;
|
||||
SolNeighbor n;
|
||||
SolNeighborhood nh(8);
|
||||
moeoSimpleSubNeighborhoodExplorer<SolNeighbor> explorer(nh, 4, eval);
|
||||
|
||||
//create source and destination population
|
||||
eoPop<Solution> src;
|
||||
eoPop<Solution> dest;
|
||||
|
||||
//create a vector for selection
|
||||
std::vector<unsigned int> v;
|
||||
v.push_back(0);
|
||||
|
||||
//create a solution
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
s.push_back(true);
|
||||
|
||||
//set its objective vector
|
||||
o[0]=8;
|
||||
o[1]=0;
|
||||
s.objectiveVector(o);
|
||||
|
||||
// aplly a move on th solution
|
||||
n.index(3);
|
||||
eval(s,n);
|
||||
n.move(s);
|
||||
s.objectiveVector(n.fitness());
|
||||
|
||||
//print initial sol
|
||||
std::cout << "solution:" << std::endl;
|
||||
std::cout << s << std::endl;
|
||||
|
||||
//copy the solution in the source population
|
||||
src.push_back(s);
|
||||
|
||||
//test the explorer (only 4 neighbors are visited)
|
||||
explorer(src, v, dest);
|
||||
|
||||
//verify the destination population
|
||||
assert(dest.size()==4);
|
||||
|
||||
assert(dest[0].objectiveVector()[0]==6);
|
||||
assert(dest[1].objectiveVector()[0]==6);
|
||||
assert(dest[2].objectiveVector()[0]==6);
|
||||
assert(dest[3].objectiveVector()[0]==8);
|
||||
|
||||
assert(dest[0].objectiveVector()[1]==2);
|
||||
assert(dest[1].objectiveVector()[1]==2);
|
||||
assert(dest[2].objectiveVector()[1]==2);
|
||||
assert(dest[3].objectiveVector()[1]==0);
|
||||
|
||||
std::cout << "destination:" << std::endl;
|
||||
for(unsigned int i=0; i<dest.size(); i++)
|
||||
std::cout << dest[i] << std::endl;
|
||||
|
||||
std::cout << "[t-moeoSimpleSubNeighborhoodExplorer] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue