I'm totally new at c++ and i need to understand the code from a a library calle Paridaseo, i did the whole tutorial here and have tried to search others more advanced tutorials but i still find myself with a lot of questions about some pieces of code in this library, at this moment i just find out this piece of code:
and i don't understand why it is wrapped between '+', im sorry if it is a silly question but my search of the funtion of '+' when it is wrapping something in google it has been useless.
Alright, the url for this library is http://paradiseo.gforge.inria.fr/ and I only mention this because I could not find this whatsoever via Google. Not sure where you're getting this snippet of code from, though. What file does it originate from?
///////////////////// // INITIALIZATION ////////////////////
// position initialization
{+eoUniformGenerator < double >uGen (POS_INIT_MIN, POS_INIT_MAX);
eoInitFixedLength < Particle > random(VEC_SIZE, uGen);+}
pop.append (POP_SIZE, random);
// velocities initialization component
{+eoUniformGenerator < double >sGen (VELOCITY_INIT_MIN, VELOCITY_INIT_MAX);
eoVelocityInitFixedLength < Particle > veloRandom (VEC_SIZE, sGen);+}
// first best position initialization component
eoFirstIsBestInit < Particle > localInit;
// Create an eoInitialier that:
// - performs a first evaluation of the particles
// - initializes the velocities
// - the first best positions of each particle
// - setups the topology
eoInitializer <Particle> fullInit(eval,veloRandom,localInit,topology,pop);
// Full initialization here to be able to print the initial population
// Else: give the "init" component in the eoEasyPSO constructor
fullInit();
/////////////////////
// INITIALIZATION
////////////////////
// position initialization
eoUniformGenerator < double >uGen (POS_INIT_MIN, POS_INIT_MAX);
eoInitFixedLength < Particle > random (VEC_SIZE, uGen);
pop.append (POP_SIZE, random);
// velocities initialization component
eoUniformGenerator < double >sGen (VELOCITY_INIT_MIN, VELOCITY_INIT_MAX);
eoVelocityInitFixedLength < Particle > veloRandom (VEC_SIZE, sGen);
// first best position initialization component
eoFirstIsBestInit < Particle > localInit;
// Create an eoInitialier that:
// - performs a first evaluation of the particles
// - initializes the velocities
// - the first best positions of each particle
// - setups the topology
eoInitializer <Particle> fullInit(eval,veloRandom,localInit,topology,pop);
// Full initialization here to be able to print the initial population
// Else: give the "init" component in the eoEasyPSO constructor
fullInit();
(I couldn't see how to browse their GIT repository online so downloaded the source archive - ParadiseEO-2.0.1.zip)