title: How do I ensure that my fitness keep in range after mutation steps?
body: <p>I use sphere benchmark function to test evolutionary strategy code with uncorrelate one step size mutation as follow:</p>
  
  <pre><code>public class cromosome {
   private double[] variable = new double[2];
      private double[] stepSize = new double[2];
      private double fitness=0;
      }
  
  //=========================method set fitness=========================================
      public void setFitness() {
          for (int i=0; i&lt;variable.length; i++) {
              fitness += variable[i]*variable[i];  
          } 
          System.out.println("fitness=  " + fitness);
      }
  </code></pre>
  
  <p>my values are in range[-10;+10] after applying mutation steps its seems that my fitness is out of range.
  this my mutation method </p>
  
  <pre><code> public static cromosome Mutation(cromosome cro) {
          //Mutations with no correlation with one step size
          Random r = new Random();
          double a = r.nextGaussian();
          double lr = 1 / (Math.sqrt(cro.getVariableLenght()));
          double[] newMutationStep = new double[1];
          newMutationStep[0] = cro.getMutationStep(0) * (Math.exp(lr * a));
  
          double[] newVariable = new double[2];
          for (int i = 0; i &lt; cro.getVariableLenght(); i++) {
              double b = r.nextGaussian();
              newVariable[i] = cro.getVariable(i) + newMutationStep[0] * b;
          }
          cromosome newKromosom = new cromosome(newVariable[0], newVariable[1], newMutationStep[0]);
          return newKromosom;
      }
  </code></pre>
  
  <p>after many iteration the fitness values are out of range, how can I control my fitness ?</p>