public override bool Equals(object obj) { if (!(obj is Individual other)) { return(false); } return(DecisionVector.Equals(other.DecisionVector) && SolutionVector.SequenceEqual(other.SolutionVector)); }
/// <summary> /// Returns a shallow copy of the Individual /// </summary> public Individual Clone() { var newIndividual = new Individual(DecisionVector) { SolutionVector = (double[])SolutionVector.Clone(), Fitness = Fitness, Legal = Legal, State = State, }; foreach (var key in properties.Keys) { newIndividual.SetProperty(key, properties[key]); } return(newIndividual); }