From b5382fce748225d03b3bc949254c84e1a478ae73 Mon Sep 17 00:00:00 2001 From: evomarc Date: Mon, 4 Dec 2000 14:55:18 +0000 Subject: [PATCH] - added the #define for eo_verbose (true) and eo_no_verbose (false) - added the eoNormMutation, simple normal mutation for simple real variables --- eo/tutorial/html/FirstRealEA.html | 9 +++++++-- eo/tutorial/html/SecondBitEA.html | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/eo/tutorial/html/FirstRealEA.html b/eo/tutorial/html/FirstRealEA.html index 03505b290..e4a22e43e 100644 --- a/eo/tutorial/html/FirstRealEA.html +++ b/eo/tutorial/html/FirstRealEA.html @@ -117,11 +117,13 @@ The actual code is in boldface and the comment in normal face.  const float P_CROSS = 0.8; // Crossover probability
 const float P_MUT = 0.5; // mutation probability
 const double EPSILON = 0.01; // range for real uniform mutation
+  const double SIGMA = 0.01; // std. dev. of normal mutation
 // some parameters for chosing among different operators
 const double segmentRate = 0.5;        // rate for 1-pt Xover
 const double arithmeticRate = 0.5;        // rate for 2-pt Xover
 const double uniformMutRate = 0.5;          // rate for bit-flip mutation
 const double detMutRate = 0.5;            // rate for one-bit mutation
+  const double normMutRate = 0.5;            // rate for normal mutation
@@ -242,7 +244,7 @@ The actual code is in boldface and the comment in normal face.  eoArithmeticCrossover<Indi> xoverA;
 // Combine them with relative rates
 eoPropCombinedQuadOp<Indi> xover(xoverS, segmentRate);
-  xover.add(xoverA, arithmeticRate, true);
+  xover.add(xoverA, arithmeticRate, eo_verbose);
@@ -252,13 +254,16 @@ The actual code is in boldface and the comment in normal face.  
+  // Gaussian mutation - std dev as argument
+  eoNormalMutation<Indi>  mutationN(SIGMA);
 // offspring(i) uniformly chosen in [parent(i)-epsilon, parent(i)+epsilon]
 eoUniformMutation<Indi>  mutationU(EPSILON);
 // k (=1) coordinates of parents are uniformly modified
 eoDetUniformMutation<Indi>  mutationD(EPSILON);
 // Combine them with relative rates
 eoPropCombinedMonOp<Indi> mutation(mutationU, uniformMutRate);
-  mutation.add(mutationD, detMutRate, true);
+  mutation.add(mutationD, detMutRate);
+  mutation.add(mutationN, normMutRate, eo_verbose);
 
 // The operators are  encapsulated into an eoTRansform object
 eoSGATransform<Indi> transform(xover, P_CROSS, mutation, P_MUT);
diff --git a/eo/tutorial/html/SecondBitEA.html b/eo/tutorial/html/SecondBitEA.html index 222cc9883..599086570 100644 --- a/eo/tutorial/html/SecondBitEA.html +++ b/eo/tutorial/html/SecondBitEA.html @@ -396,7 +396,7 @@ rates
onePointRate);
 xover.add(xoverU, URate);
 xover.add(xover2, twoPointsRate, -true); +eo_verbose); @@ -413,7 +413,7 @@ rates
 eoPropCombinedMonOp<Indi> mutation(mutationBitFlip, bitFlipRate);
 mutation.add(mutationOneBit, oneBitRate, -true); +eo_verbose);
 // The operators are  encapsulated into an eoTRansform object
 eoSGATransform<Indi> transform(xover,