public override IOperation InstrumentedApply() { IVRPEncoding solution = VRPToursParameter.ActualValue; if (!(solution is GVREncoding)) { VRPToursParameter.ActualValue = GVREncoding.ConvertFrom(solution, ProblemInstance); } Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as GVREncoding); return(base.InstrumentedApply()); }
public override IOperation InstrumentedApply() { ItemArray <IVRPEncoding> parents = new ItemArray <IVRPEncoding>(ParentsParameter.ActualValue.Length); for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { IVRPEncoding solution = ParentsParameter.ActualValue[i]; if (!(solution is GVREncoding)) { parents[i] = GVREncoding.ConvertFrom(solution, ProblemInstance); } else { parents[i] = solution; } } ParentsParameter.ActualValue = parents; ChildParameter.ActualValue = Crossover(RandomParameter.ActualValue, parents[0] as GVREncoding, parents[1] as GVREncoding); return(base.InstrumentedApply()); }