1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Data;
|
---|
4 | using HeuristicLab.Parameters;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
7 | using HeuristicLab.Problems.VehicleRouting;
|
---|
8 | using HeuristicLab.Problems.VehicleRouting.Interfaces;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory.VRP {
|
---|
11 |
|
---|
12 | [StorableClass]
|
---|
13 | public class PreassignedVRPSolutionCreator : PreassignedSolutionCreator, IVRPCreator {
|
---|
14 |
|
---|
15 |
|
---|
16 | [StorableConstructor]
|
---|
17 | protected PreassignedVRPSolutionCreator(bool deserializing) : base(deserializing) { }
|
---|
18 | protected PreassignedVRPSolutionCreator(PreassignedVRPSolutionCreator original, Cloner cloner)
|
---|
19 | : base(original, cloner) {
|
---|
20 | }
|
---|
21 | public PreassignedVRPSolutionCreator() {
|
---|
22 | Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The created VRP tour."));
|
---|
23 | Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance."));
|
---|
24 | }
|
---|
25 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
26 | return new PreassignedVRPSolutionCreator(this, cloner);
|
---|
27 | }
|
---|
28 |
|
---|
29 | public override void Create(IScope scope) {
|
---|
30 | VRPToursParameter.ActualValue = (IVRPEncoding)scope.Variables[VRPToursParameter.ActualName].Value;
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
34 | #region IVRPCreator Members
|
---|
35 | public ILookupParameter<IVRPEncoding> VRPToursParameter {
|
---|
36 | get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
|
---|
37 | }
|
---|
38 | #endregion
|
---|
39 |
|
---|
40 | public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter {
|
---|
41 | get { return (ILookupParameter<IVRPProblemInstance>)Parameters["ProblemInstance"]; }
|
---|
42 | }
|
---|
43 | }
|
---|
44 | }
|
---|