Code wrapped between '+'

Hi,

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:

1
2
  {+eoUniformGenerator < double >sGen (VELOCITY_INIT_MIN, VELOCITY_INIT_MAX);
    eoVelocityInitFixedLength < Particle > veloRandom (VEC_SIZE, sGen);+}


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.

thanks in advance.
Looks like a mistake if you ask me. Have you actually been able to compile this code?
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?
Googling "+eoUniformGenerator" (with quotes) found it for me.

http://paradiseo.gforge.inria.fr/index.php?n=Doc.TutoEOLesson6part1Compil

From Tutorial Lesson6 - Fitness Landscapes Analysis
File RealPSO.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
///////////////////// // 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();


Andy
Last edited on
It does looks like it is just a problem with the documentation. The same fragment lifted from the source is (no {+ +}s !!):

From ...\ParadisEO-2.0\eo\tutorial\Lesson6\RealPSO.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/////////////////////
// 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)

Andy
Last edited on
Yeah, that seems to be the case. The git repo, by the way, can be browsed at https://github.com/nojhan/paradiseo
Thanks for the link -- I just tried to find a link on the http://paradiseo.gforge.inria.fr webpage when I should have googled!

RealPSO.cpp can be found here:

https://github.com/nojhan/paradiseo/blob/master/eo/tutorial/Lesson6/RealPSO.cpp

BTW the official repo is:

https://gforge.inria.fr/scm/browser.php?group_id=145

with the master version of the file being found (currently) at:

https://scm.gforge.inria.fr/anonscm/gitweb?p=paradiseo/paradiseo.git;a=blob;f=eo/tutorial/Lesson6/RealPSO.cpp;h=23f67100fdb975e23a966c5ecd50de8237c9c79e;hb=refs/heads/master

Andy
Last edited on
Thank you all!!
Topic archived. No new replies allowed.