Example #1
0
 public void Mutate(BaseInstance Instance)
 {
     Instance.Value += Simulation.random.NextDouble() * 2.0 * MutationRate - MutationRate;
     if (Instance.Value < Minvalue)
     {
         Instance.Value = Minvalue;
     }
     else if (Instance.Value > Maxvalue)
     {
         Instance.Value = Maxvalue;
     }
 }
Example #2
0
 public void Randomize(BaseInstance Instance)
 {
     Instance.Value = Simulation.random.NextDouble() * (Maxvalue - Minvalue) + Minvalue;
 }