Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 12563 was 9750, checked in by gkronber, 11 years ago

#1591: adapted FLA branch to reference most recent version of ALGLIB (3.7.0) and VRP (3.4). Several major changes were necessary to port the implementation to the new VRP problem.

File size: 1.7 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;
8using HeuristicLab.Problems.VehicleRouting.Interfaces;
9
10namespace 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}
Note: See TracBrowser for help on using the repository browser.