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; 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("Capacity")); Parameters.Add(new LookupParameter("Coordinates")); Parameters.Add(new LookupParameter("Demand")); Parameters.Add(new LookupParameter("DistanceMatrix")); Parameters.Add(new LookupParameter("DueTime")); Parameters.Add(new LookupParameter("ReadyTime")); Parameters.Add(new LookupParameter("ServiceTime")); Parameters.Add(new LookupParameter("UseDistanceMatrix")); Parameters.Add(new LookupParameter("Vehicles")); } 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"]; } } public ILookupParameter CapacityParameter { get { return (ILookupParameter) Parameters["Capacity"]; } } public int Cities { get; private set; } public ILookupParameter CoordinatesParameter { get { return (ILookupParameter) Parameters["Coordinates"]; } } public ILookupParameter DemandParameter { get { return (ILookupParameter) Parameters["Demand"]; } } public ILookupParameter DistanceMatrixParameter { get { return (ILookupParameter) Parameters["DistanceMatrix"]; } } public ILookupParameter DueTimeParameter { get { return (ILookupParameter) Parameters["DueTime"]; } } public ILookupParameter ReadyTimeParameter { get { return (ILookupParameter) Parameters["ReadyTime"]; } } public ILookupParameter ServiceTimeParameter { get { return (ILookupParameter) Parameters["ServiceTime"]; } } public ILookupParameter UseDistanceMatrixParameter { get { return (ILookupParameter) Parameters["UseDistanceMatrix"]; } } public ILookupParameter VehiclesParameter { get { return (ILookupParameter) Parameters["Vehicles"]; } } #endregion } }