Difference between revisions of "Evolving shapes/en"

From RoboWiki
Jump to: navigation, search
m
 
(12 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
----
 
----
 +
 +
<h2>Source code</h2>
 +
 +
'''CVS repository RELEASE version''' [http://webcvs.robotika.sk/cgi-bin/cvsweb/evodesign/RELEASE]
 +
 
<h2>Literature & Links</h2>
 
<h2>Literature & Links</h2>
  
Line 14: Line 19:
 
BREVE Simulator - '''Breve Documentation''' [http://www.spiderland.org/book/export/html/2601]
 
BREVE Simulator - '''Breve Documentation''' [http://www.spiderland.org/book/export/html/2601]
  
[http://www2.lifl.fr/~cahon/paradisEO/common/ ParadisEO] - '''ParadisEO Documentation - slides''' [http://eodev.sourceforge.net/eo/tutorial/pdf/paradiseoJet7.pdf]
+
 
 +
[http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.Home?from=Main.HomePage ParadisEO] - '''ParadisEO Documentation - slides''' [http://eodev.sourceforge.net/eo/tutorial/pdf/paradiseoJet7.pdf]
  
 
Funes, Pollack - '''Computer Evolution of Buildable Objects''' [http://www.demo.cs.brandeis.edu/papers/other/cs-97-191.html]
 
Funes, Pollack - '''Computer Evolution of Buildable Objects''' [http://www.demo.cs.brandeis.edu/papers/other/cs-97-191.html]
Line 37: Line 43:
  
 
<h2>Evolutionary algorithms</h2>
 
<h2>Evolutionary algorithms</h2>
 +
 +
[http://www.cs.vu.nl/~jabekker/ec0607/ Eiben's Evolutionary Computing]
 +
 +
[http://www.cs.cmu.edu/Groups/AI/html/faqs/ai/genetic/part2/faq.html Hitchhiker's guide to Evolutionary Algorithms]
 +
 +
[http://eodev.sourceforge.net/eo/tutorial/html/eoEngine.html#selection EO implementation description]
 +
 
[http://en.wikipedia.org/wiki/Genotype Genotype] - in slovak lang.: ''reprezentacia subjektu evolucie (jedinca) vo forme vhodnej na operatory krizenia, mutacie, na evaluaciu fitness a na ine'' ?
 
[http://en.wikipedia.org/wiki/Genotype Genotype] - in slovak lang.: ''reprezentacia subjektu evolucie (jedinca) vo forme vhodnej na operatory krizenia, mutacie, na evaluaciu fitness a na ine'' ?
  
 
----
 
----
 +
 
<h2>ODE examples and comments</h2>
 
<h2>ODE examples and comments</h2>
  
[[www.ode.org Open Dynamics Engine]]<br>
+
[http://www.ode.org Open Dynamics Engine]<br>
[[http://www.newtondynamics.com Newton Dynamics]]<br>
+
[http://www.newtondynamics.com Newton Dynamics]<br>
  
 
Red point  = point (1, 0, 0) - along x-axis<br/>
 
Red point  = point (1, 0, 0) - along x-axis<br/>
Line 117: Line 131:
 
</nowiki></pre>
 
</nowiki></pre>
 
</p>
 
</p>
 +
 +
<strong>IMPORTANT:</strong> MAX_CONTACTS must be more than 1 -> otherwise Floating exception occurs (see juro8-Big.cpp) - so for example MAX_CONTACTS=2 used
 +
 +
CONSTANTS:
 +
<pre><nowiki>
 +
#define NUM 2000 // max number of objects
 +
#define DENSITY_ROTOR (10.0) // density of rotor
 +
#define DENSITY_AIR (1.0) // density of air particle
 +
#define MAX_CONTACTS 2 // maximum number of contact points per body
 +
#define NEW_PER_STEP 10 // must be less then NUM
 +
#define TIMESTEP 0.01
 +
#define MOLECULE_SIZE 0.1
 +
#define INITIAL_VELOCITY_Y 10.0
 +
#define DAMPING_COEF 0.0001
 +
#define THICKNESS_OF_BLADE 0.1
 +
#define PI 3.14159265
 +
</nowiki></pre>
 +
 +
<p>Example:<br/>
 +
size of blade: 10mx6mx0.1m<br/>
 +
surface perpendicular to air flow = cca 50m^2 => in 1 sec (= 100 timesteps) at 10m.s^-1  500kg of air (1kg.m^-3) pushes on surface<br/>
 +
average hit rate by air particles in 1 sec (= 100 timesteps) is 1250 => 0.4kg for 1 particle</br>
 +
0.4 per particle with 0.1m radius => 100kg.m^-3 density of particle<br/>
 +
density of rotor is 10times more than particle, because normally we take density of rotor 1000kg.m^-3
 +
</p>
 +
 +
<h2>Memory bug - segmentation fault (linux) - stack overflow (windows) - fixed (at least looks like that)</h2>
 +
<pre><nowiki>
 +
// Use the error-checking memory allocation system.  Because this system uses heap
 +
//  (malloc) instead of stack (alloca), it is slower.  However, it allows you to
 +
//  simulate larger scenes, as well as handle out-of-memory errors in a somewhat
 +
//  graceful manner
 +
 +
#define dUSE_MALLOC_FOR_ALLOCA
 +
 +
#ifdef dUSE_MALLOC_FOR_ALLOCA
 +
enum {
 +
  d_MEMORY_OK = 0, /* no memory errors */
 +
  d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error */
 +
};
 +
 +
#endif
 +
</nowiki></pre>
 +
 +
<h2>Distributed evolution - example</h2>
 +
<strong>Evaluator program</strong><br/>
 +
[[http://www.yames.biz/mt/evaluator-DB-2.zip Windows version]]<br/>
 +
[[http://virtuallab.kar.elf.stuba.sk/~plavcan/evodesign/evaluator-DB-2_task.bash Linux script]]<br/>
 +
[[Image:distr-evolution.JPG]]
  
 
<noinclude>
 
<noinclude>
 
{{Footer}}
 
{{Footer}}
 
</noinclude>
 
</noinclude>

Latest revision as of 14:18, 29 February 2008

CVS repository:

TODO...

Issues...


Source code

CVS repository RELEASE version [1]

Literature & Links

Mark Ebner - Evolutionary design [2]

Kenny Erleben - Multibody dynamics [3]

BREVE Simulator - Breve Documentation [4]


ParadisEO - ParadisEO Documentation - slides [5]

Funes, Pollack - Computer Evolution of Buildable Objects [6]

Piyush Kumar - Triangle++ - Delaunay triangulation code [7]

wikipedia - Delaunay triangulation [8]


Parallel Computing Section

Introduction to PVM programming

PVM short description - [9]

ParadisEO is using either MPI (LAM-MPI) or PVM. LAM-MPI is mostly for UNIX platforms - difficult to install on Windows. PVM should run everywhere.
New MPI implementation - OPEN MPI


Evolutionary algorithms

Eiben's Evolutionary Computing

Hitchhiker's guide to Evolutionary Algorithms

EO implementation description

Genotype - in slovak lang.: reprezentacia subjektu evolucie (jedinca) vo forme vhodnej na operatory krizenia, mutacie, na evaluaciu fitness a na ine ?


ODE examples and comments

Open Dynamics Engine
Newton Dynamics

Red point = point (1, 0, 0) - along x-axis
Blue point = point (0, 1, 0) - along y-axis
Z-axis goes up

WARNING: use only float (not double) with TriMesh

First version of air particles flying through propeller
Vzduch.JPG


Tuned version of particles flying through propeller with source code: source 2
Rotor2.jpg

Notes:
  • Friction set to 0, dInfinity value is causing unrealistic and strange behaviour
  • Density of particles is just approximatelly 4 times smaller than that of propeller
  • Size of particles is big (10 times bigger than thickness of blade of propeller)

To be able to use complex rotation for next TriMesh example, a study of Quaternions is inevitable.
Applications of Quaternions


Same example as above but with Triangular Mesh representation - at the moment very simple - source 3
Rotor3.JPG

Notes:
  • For 2 consecutive simple rotation, 2 conversion from simple rotational matrix to quaternion was used, followed by quaternion multiplication and conversion back to complex rotational matrix
  • Geom of blades is represented by 0-thin triangle, but with defined mass (based on the volume of blade with 0.001-thickness
  • Blades are visible only from the 'front' - from the side of impacting particles

Rotor with complex TriMesh blades - source 4
Rotor4.JPG

Notes:
  • Missing lines in Triangular Mesh is just visualization bug

Simulation without graphical output - source 6

Parameters:
  • Total number of particles: 1000
  • Particle size: 0.000 001
  • Tiangle side length (in TriMesh): 0.05
  • Density of rotor: 1.0
  • Density of particle: 10 000 000.0
  • Initial force: 0.000 1
  • Time step: 0.01

Running time:

MachineDebug timeOptimized time
1.6GHz Linux13.42s13.02s
2x2.16GHz WinXP43.68s7.77s

Angular velocity of rotor after last step of simulation: 1.20865

IMPORTANT: Particle size >= TimeStep x Particle Velocity, otherwise particle can fly through TriMesh, as it is "jumping" in steps along its trajectory, it is not continuous flight. Therefore it is not feasible to use too tiny particles, as it would require step size too small or velocity too small, or both, in any case the simulation would be terribly slow.

Code for random generator initialization:

#include <ctime>

time_t tim;
dRandSetSeet ((unsigned long) time (&tim));

IMPORTANT: MAX_CONTACTS must be more than 1 -> otherwise Floating exception occurs (see juro8-Big.cpp) - so for example MAX_CONTACTS=2 used

CONSTANTS:

#define NUM 2000			// max number of objects
#define DENSITY_ROTOR (10.0)		// density of rotor
#define DENSITY_AIR (1.0)	// density of air particle
#define MAX_CONTACTS 2		// maximum number of contact points per body
#define NEW_PER_STEP	10		// must be less then NUM
#define TIMESTEP	0.01
#define MOLECULE_SIZE	0.1
#define INITIAL_VELOCITY_Y 10.0
#define DAMPING_COEF 0.0001
#define THICKNESS_OF_BLADE 0.1
#define PI 3.14159265

Example:
size of blade: 10mx6mx0.1m
surface perpendicular to air flow = cca 50m^2 => in 1 sec (= 100 timesteps) at 10m.s^-1 500kg of air (1kg.m^-3) pushes on surface
average hit rate by air particles in 1 sec (= 100 timesteps) is 1250 => 0.4kg for 1 particle</br> 0.4 per particle with 0.1m radius => 100kg.m^-3 density of particle
density of rotor is 10times more than particle, because normally we take density of rotor 1000kg.m^-3

Memory bug - segmentation fault (linux) - stack overflow (windows) - fixed (at least looks like that)

// Use the error-checking memory allocation system.  Because this system uses heap
//  (malloc) instead of stack (alloca), it is slower.  However, it allows you to
//  simulate larger scenes, as well as handle out-of-memory errors in a somewhat
//  graceful manner

 #define dUSE_MALLOC_FOR_ALLOCA

#ifdef dUSE_MALLOC_FOR_ALLOCA
enum {
  d_MEMORY_OK = 0,		/* no memory errors */
  d_MEMORY_OUT_OF_MEMORY	/* malloc failed due to out of memory error */
};

#endif

Distributed evolution - example

Evaluator program
[Windows version]
[Linux script]
Distr-evolution.JPG



--- --- --- English: Evolving shapes/en/en Slovensky: Evolving shapes/en/sk --- --- ---
--- --- --- --- --- RoboWiki: (c) 2006 Robotika.sk --- --- --- --- ---