Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 14876 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
RevLine 
[7163]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;
[9750]8using HeuristicLab.Problems.VehicleRouting.Interfaces;
[7163]9
10namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory.VRP {
11
12  [StorableClass]
13  public class PreassignedVRPSolutionCreator : PreassignedSolutionCreator, IVRPCreator {
14
[9750]15
[7163]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."));
[9750]23      Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance."));
[7163]24    }
25    public override IDeepCloneable Clone(Cloner cloner) {
26      return new PreassignedVRPSolutionCreator(this, cloner);
27    }
28
29    public override void Create(IScope scope) {
[9750]30      VRPToursParameter.ActualValue = (IVRPEncoding)scope.Variables[VRPToursParameter.ActualName].Value;
[7163]31    }
32
33
34    #region IVRPCreator Members
35    public ILookupParameter<IVRPEncoding> VRPToursParameter {
[9750]36      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
[7163]37    }
[9750]38    #endregion
39
40    public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter {
41      get { return (ILookupParameter<IVRPProblemInstance>)Parameters["ProblemInstance"]; }
[7163]42    }
43  }
44}
Note: See TracBrowser for help on using the repository browser.