fix even more warnings and reduce some tests runtimes
tested under gcc and clang
This commit is contained in:
parent
ddb261348c
commit
9d3c848dfb
9 changed files with 29 additions and 26 deletions
|
|
@ -71,7 +71,7 @@ std::pair< eoAlgo<Particle>*, eoPop<Particle>* >
|
|||
auto& random_pos = store.pack< eoInitFixedLength<Particle> >(dim, gen_pos);
|
||||
|
||||
auto pop = new eoPop<Particle>();
|
||||
pop->append(100, random_pos); // pop size
|
||||
pop->append(10, random_pos); // pop size
|
||||
|
||||
auto& gen_minus = store.pack< eoUniformGenerator<double> >(-0.05, 0.05);
|
||||
auto& random_velo = store.pack< eoVelocityInitFixedLength<Particle> >(dim, gen_minus);
|
||||
|
|
@ -89,7 +89,7 @@ std::pair< eoAlgo<Particle>*, eoPop<Particle>* >
|
|||
|
||||
auto& flight = store.pack< eoStandardFlight<Particle> >();
|
||||
|
||||
auto& cont_gen = store.pack< eoGenContinue<Particle> >(50);
|
||||
auto& cont_gen = store.pack< eoGenContinue<Particle> >(10);
|
||||
auto& cont = store.pack< eoCombinedContinue<Particle> >(cont_gen);
|
||||
|
||||
auto& checkpoint = store.pack< eoCheckPoint<Particle> >(cont);
|
||||
|
|
@ -122,7 +122,7 @@ int main(int /*argc*/, char** /*argv*/)
|
|||
|
||||
// Evaluation of a forged algo on the sub-problem
|
||||
eoBooleanGenerator gen(0.5);
|
||||
eoInitFixedLength<Bits> onemax_init(/*bitstring size=*/500, gen);
|
||||
eoInitFixedLength<Bits> onemax_init(/*bitstring size=*/50, gen);
|
||||
eoEvalFoundryEA<Particle,Bits> eval_foundry(foundry,
|
||||
onemax_init, /*pop_size=*/ 10,
|
||||
onemax_eval, /*penalization=*/ 0);
|
||||
|
|
|
|||
|
|
@ -42,15 +42,16 @@ int main() {
|
|||
eoUniformGenerator<double> u2(0.003, 0.05 );
|
||||
eoUniformGenerator<unsigned long> u3( 10000U, 10000000U);
|
||||
|
||||
try
|
||||
{ // throws an error
|
||||
eoUniformGenerator<unsigned long> utest( 10000000U, 10000U);
|
||||
throw; // if this succeeds something is wrong, make sure that that is noticed
|
||||
}
|
||||
catch (std::logic_error& e)
|
||||
{
|
||||
std::cout << e.what() << std::endl;
|
||||
}
|
||||
// Test replaced by an assert
|
||||
// try
|
||||
// { // throws an error
|
||||
// eoUniformGenerator<unsigned long> utest( 10000000U, 10000U);
|
||||
// throw; // if this succeeds something is wrong, make sure that that is noticed
|
||||
// }
|
||||
// catch (std::logic_error& e)
|
||||
// {
|
||||
// std::cout << e.what() << std::endl;
|
||||
// }
|
||||
|
||||
std::ofstream os("t-eoRandom.out");
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ int main_function(int /*argc*/, char **/*argv*/)
|
|||
topology.setup(pop);
|
||||
std::cout<<"\n\n\nPopulation :\n\n"<<pop;
|
||||
std::cout<<"\n\nNeighborhood :\n\n";
|
||||
topology.printOn();
|
||||
topology.printOn(std::cout);
|
||||
int k = NEIGHBORHOOD_SIZE/2;
|
||||
for(unsigned i=0;i<pop.size();i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue