using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.Encodings.PermutationEncoding; using HeuristicLab.Problems.VehicleRouting; using HeuristicLab.Problems.VehicleRouting.Interfaces; namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory.VRP { [StorableClass] public class PreassignedVRPSolutionCreator : PreassignedSolutionCreator, IVRPCreator { [StorableConstructor] protected PreassignedVRPSolutionCreator(bool deserializing) : base(deserializing) { } protected PreassignedVRPSolutionCreator(PreassignedVRPSolutionCreator original, Cloner cloner) : base(original, cloner) { } public PreassignedVRPSolutionCreator() { Parameters.Add(new LookupParameter("VRPTours", "The created VRP tour.")); Parameters.Add(new LookupParameter("ProblemInstance", "The VRP problem instance.")); } public override IDeepCloneable Clone(Cloner cloner) { return new PreassignedVRPSolutionCreator(this, cloner); } public override void Create(IScope scope) { VRPToursParameter.ActualValue = (IVRPEncoding)scope.Variables[VRPToursParameter.ActualName].Value; } #region IVRPCreator Members public ILookupParameter VRPToursParameter { get { return (ILookupParameter)Parameters["VRPTours"]; } } #endregion public ILookupParameter ProblemInstanceParameter { get { return (ILookupParameter)Parameters["ProblemInstance"]; } } } }