Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/24/20 00:58:42 (4 years ago)
Author:
abeham
Message:

#2521: working on VRP (WIP)

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarExhaustiveMoveGenerator.cs

    r17226 r17698  
    4646    }
    4747
    48     protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncoding individual, IVRPProblemInstance problemInstance) {
     48    protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) {
    4949      List<PotvinTwoOptStarMove> result = new List<PotvinTwoOptStarMove>();
    5050
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMove.cs

    r17226 r17698  
    3232  public class PotvinTwoOptStarMove : Item, IVRPMove {
    3333    [Storable]
    34     public IVRPEncoding Individual { get; protected set; }
     34    public IVRPEncodedSolution Individual { get; protected set; }
    3535
    3636    [Storable]
     
    5656    }
    5757
    58     public PotvinTwoOptStarMove(int tour1, int x1, int tour2, int x2, PotvinEncoding individual) {
     58    public PotvinTwoOptStarMove(int tour1, int x1, int tour2, int x2, PotvinEncodedSolution individual) {
    5959      Tour1 = tour1;
    6060      X1 = x1;
     
    6262      X2 = x2;
    6363
    64       this.Individual = individual.Clone() as PotvinEncoding;
     64      this.Individual = individual.Clone() as PotvinEncodedSolution;
    6565    }
    6666
     
    7676      this.X2 = original.X2;
    7777
    78       this.Individual = cloner.Clone(Individual) as PotvinEncoding;
     78      this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution;
    7979    }
    8080
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveEvaluator.cs

    r17226 r17698  
    5555      PotvinTwoOptStarMove move = TwoOptStarMoveParameter.ActualValue;
    5656
    57       PotvinEncoding newSolution = TwoOptStarMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;
     57      PotvinEncodedSolution newSolution = TwoOptStarMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution;
    5858      PotvinTwoOptStarMoveMaker.Apply(newSolution, move, ProblemInstance);
    5959
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveGenerator.cs

    r17226 r17698  
    5555    }
    5656
    57     protected abstract PotvinTwoOptStarMove[] GenerateMoves(PotvinEncoding individual, IVRPProblemInstance problemInstance);
     57    protected abstract PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance);
    5858
    5959    public override IOperation InstrumentedApply() {
    6060      IOperation next = base.InstrumentedApply();
    6161
    62       PotvinEncoding individual = VRPToursParameter.ActualValue as PotvinEncoding;
     62      PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution;
    6363      PotvinTwoOptStarMove[] moves = GenerateMoves(individual, ProblemInstance);
    6464      Scope[] moveScopes = new Scope[moves.Length];
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveMaker.cs

    r17226 r17698  
    5757
    5858    public static void GetSegments(PotvinTwoOptStarMove move, out List<int> segmentX1, out List<int> segmentX2) {
    59       PotvinEncoding solution = move.Individual as PotvinEncoding;
     59      PotvinEncodedSolution solution = move.Individual as PotvinEncodedSolution;
    6060
    6161      Tour route1 = solution.Tours[move.Tour1];
     
    7878    }
    7979
    80     public static void Apply(PotvinEncoding solution, PotvinTwoOptStarMove move, IVRPProblemInstance problemInstance) {
     80    public static void Apply(PotvinEncodedSolution solution, PotvinTwoOptStarMove move, IVRPProblemInstance problemInstance) {
    8181      List<int> segmentX1;
    8282      List<int> segmentX2;
     
    9898      PotvinTwoOptStarMove move = TwoOptStarMoveParameter.ActualValue;
    9999
    100       PotvinEncoding newSolution = move.Individual.Clone() as PotvinEncoding;
     100      PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution;
    101101      Apply(newSolution, move, ProblemInstance);
    102102      newSolution.Repair();
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveTabuCriterion.cs

    r17226 r17698  
    4545      get { return TwoOptStarMoveParameter; }
    4646    }
    47     public ILookupParameter<IVRPEncoding> VRPToursParameter {
    48       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
     47    public ILookupParameter<IVRPEncodedSolution> VRPToursParameter {
     48      get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; }
    4949    }
    5050    public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter {
     
    8989      : base() {
    9090      Parameters.Add(new LookupParameter<PotvinTwoOptStarMove>("PotvinTwoOptStarMove", "The moves that should be made."));
    91       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours considered in the move."));
     91      Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move."));
    9292      Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance"));
    9393
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveTabuMaker.cs

    r17226 r17698  
    5757      get { return TwoOptStarMoveParameter; }
    5858    }
    59     public ILookupParameter<IVRPEncoding> VRPToursParameter {
    60       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
     59    public ILookupParameter<IVRPEncodedSolution> VRPToursParameter {
     60      get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; }
    6161    }
    6262    public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter {
     
    8686
    8787      Parameters.Add(new LookupParameter<PotvinTwoOptStarMove>("PotvinTwoOptStarMove", "The moves that should be made."));
    88       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours considered in the move."));
     88      Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move."));
    8989      Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance"));
    9090
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMultiMoveGenerator.cs

    r17226 r17698  
    5959    }
    6060
    61     protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncoding individual, IVRPProblemInstance problemInstance) {
     61    protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) {
    6262      List<PotvinTwoOptStarMove> result = new List<PotvinTwoOptStarMove>();
    6363
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarSingleMoveGenerator.cs

    r17226 r17698  
    6161    }
    6262
    63     public static PotvinTwoOptStarMove Apply(PotvinEncoding individual, IVRPProblemInstance problemInstance, IRandom rand) {
     63    public static PotvinTwoOptStarMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) {
    6464      int route1Idx = rand.Next(individual.Tours.Count);
    6565      int route2Idx = rand.Next(individual.Tours.Count - 1);
     
    7676    }
    7777
    78     protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncoding individual, IVRPProblemInstance problemInstance) {
     78    protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) {
    7979      List<PotvinTwoOptStarMove> result = new List<PotvinTwoOptStarMove>();
    8080
Note: See TracChangeset for help on using the changeset viewer.