Free cookie consent management tool by TermsFeed Policy Generator

source: branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape.VRP/MultiTrajectory/PreassignedVRPSolutionCreator.cs @ 7163

Last change on this file since 7163 was 7163, checked in by epitzer, 12 years ago

#1703 Add PreassignedVRPSolutionCreator for multi trajectory analysis of VRPs

File size: 3.3 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Parameters;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6using HeuristicLab.Encodings.PermutationEncoding;
7using HeuristicLab.Problems.VehicleRouting;
8
9namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory.VRP {
10
11  [StorableClass]
12  public class PreassignedVRPSolutionCreator : PreassignedSolutionCreator, IVRPCreator {
13
14     
15    [StorableConstructor]
16    protected PreassignedVRPSolutionCreator(bool deserializing) : base(deserializing) { }
17    protected PreassignedVRPSolutionCreator(PreassignedVRPSolutionCreator original, Cloner cloner)
18      : base(original, cloner) {
19    }
20    public PreassignedVRPSolutionCreator() {
21      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The created VRP tour."));
22      Parameters.Add(new LookupParameter<DoubleValue>("Capacity"));
23      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates"));
24      Parameters.Add(new LookupParameter<DoubleArray>("Demand"));
25      Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix"));
26      Parameters.Add(new LookupParameter<DoubleArray>("DueTime"));
27      Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime"));
28      Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime"));
29      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix"));
30      Parameters.Add(new LookupParameter<IntValue>("Vehicles"));
31    }
32    public override IDeepCloneable Clone(Cloner cloner) {
33      return new PreassignedVRPSolutionCreator(this, cloner);
34    }
35
36    public override void Create(IScope scope) {
37      VRPToursParameter.ActualValue = (IVRPEncoding) scope.Variables[VRPToursParameter.ActualName].Value;
38    }
39
40
41    #region IVRPCreator Members
42    public ILookupParameter<IVRPEncoding> VRPToursParameter {
43      get { return (ILookupParameter<IVRPEncoding>) Parameters["VRPTours"]; }
44    }
45    public ILookupParameter<DoubleValue> CapacityParameter {
46      get { return (ILookupParameter<DoubleValue>) Parameters["Capacity"]; }
47    }
48    public int Cities { get; private set; }
49    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
50      get { return (ILookupParameter<DoubleMatrix>) Parameters["Coordinates"]; }
51    }
52    public ILookupParameter<DoubleArray> DemandParameter {
53      get { return (ILookupParameter<DoubleArray>) Parameters["Demand"]; }
54    }
55    public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
56      get { return (ILookupParameter<DoubleMatrix>) Parameters["DistanceMatrix"]; }
57    }
58    public ILookupParameter<DoubleArray> DueTimeParameter {
59      get { return (ILookupParameter<DoubleArray>) Parameters["DueTime"]; }
60    }
61    public ILookupParameter<DoubleArray> ReadyTimeParameter {
62      get { return (ILookupParameter<DoubleArray>) Parameters["ReadyTime"]; }
63    }
64    public ILookupParameter<DoubleArray> ServiceTimeParameter {
65      get { return (ILookupParameter<DoubleArray>) Parameters["ServiceTime"]; }
66    }
67    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
68      get { return (ILookupParameter<BoolValue>) Parameters["UseDistanceMatrix"]; }
69    }
70    public ILookupParameter<IntValue> VehiclesParameter {
71      get { return (ILookupParameter<IntValue>) Parameters["Vehicles"]; }
72    }
73    #endregion
74  }
75}
Note: See TracBrowser for help on using the repository browser.