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; } }
public void Randomize(BaseInstance Instance) { Instance.Value = Simulation.random.NextDouble() * (Maxvalue - Minvalue) + Minvalue; }