public virtual object Clone() { Solution ret = new Solution(d_id, d_fitness.Clone() as Fitness, d_state); ret.Copy(this); return(ret); }
public Solution(uint id, Fitness fitness, State state) { d_parameters = new List <Parameter>(); d_data = new Dictionary <string, object>(); d_id = id; d_fitness = fitness.Clone() as Fitness; d_state = state; }
private void UpdateConvergence() { uint window = (uint)d_convergenceWindow.Evaluate(Biorob.Math.Constants.Context); while (d_lastBest.Count > window) { d_lastBest.RemoveFirst(); } Fitness fitness = null; foreach (Solution solution in Population) { if (fitness == null || solution.Fitness > fitness) { fitness = solution.Fitness; } } if (fitness != null) { d_lastBest.AddLast((Fitness)fitness.Clone()); } }