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/General/Crossovers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs

    r17226 r17698  
    4848    }
    4949
    50     public ILookupParameter<ItemArray<IVRPEncoding>> ParentsParameter {
    51       get { return (ScopeTreeLookupParameter<IVRPEncoding>)Parameters["Parents"]; }
     50    public ILookupParameter<ItemArray<IVRPEncodedSolution>> ParentsParameter {
     51      get { return (ScopeTreeLookupParameter<IVRPEncodedSolution>)Parameters["Parents"]; }
    5252    }
    5353
    54     public ILookupParameter<IVRPEncoding> ChildParameter {
    55       get { return (ILookupParameter<IVRPEncoding>)Parameters["Child"]; }
     54    public ILookupParameter<IVRPEncodedSolution> ChildParameter {
     55      get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["Child"]; }
    5656    }
    5757
     
    6363      Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance"));
    6464
    65       Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed."));
     65      Parameters.Add(new ScopeTreeLookupParameter<IVRPEncodedSolution>("Parents", "The parent permutations which should be crossed."));
    6666      ParentsParameter.ActualName = "VRPTours";
    67       Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover."));
     67      Parameters.Add(new LookupParameter<IVRPEncodedSolution>("Child", "The child permutation resulting from the crossover."));
    6868      ChildParameter.ActualName = "VRPTours";
    6969
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/RandomParentCloneCrossover.cs

    r17226 r17698  
    3636    }
    3737
    38     public ILookupParameter<ItemArray<IVRPEncoding>> ParentsParameter {
    39       get { return (ScopeTreeLookupParameter<IVRPEncoding>)Parameters["Parents"]; }
     38    public ILookupParameter<ItemArray<IVRPEncodedSolution>> ParentsParameter {
     39      get { return (ScopeTreeLookupParameter<IVRPEncodedSolution>)Parameters["Parents"]; }
    4040    }
    4141
    42     public ILookupParameter<IVRPEncoding> ChildParameter {
    43       get { return (ILookupParameter<IVRPEncoding>)Parameters["Child"]; }
     42    public ILookupParameter<IVRPEncodedSolution> ChildParameter {
     43      get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["Child"]; }
    4444    }
    4545
     
    5151      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    5252
    53       Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed."));
     53      Parameters.Add(new ScopeTreeLookupParameter<IVRPEncodedSolution>("Parents", "The parent permutations which should be crossed."));
    5454      ParentsParameter.ActualName = "VRPTours";
    55       Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover."));
     55      Parameters.Add(new LookupParameter<IVRPEncodedSolution>("Child", "The child permutation resulting from the crossover."));
    5656      ChildParameter.ActualName = "VRPTours";
    5757    }
     
    6767    public override IOperation InstrumentedApply() {
    6868      if (RandomParameter.ActualValue.Next() < 0.5)
    69         ChildParameter.ActualValue = ParentsParameter.ActualValue[0].Clone() as IVRPEncoding;
     69        ChildParameter.ActualValue = ParentsParameter.ActualValue[0].Clone() as IVRPEncodedSolution;
    7070      else
    71         ChildParameter.ActualValue = ParentsParameter.ActualValue[1].Clone() as IVRPEncoding;
     71        ChildParameter.ActualValue = ParentsParameter.ActualValue[1].Clone() as IVRPEncodedSolution;
    7272
    7373      return base.InstrumentedApply();
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/VRPCrossover.cs

    r17226 r17698  
    3030  [StorableType("E26BAD0A-49E6-477C-AEA0-CB41552F0B2B")]
    3131  public abstract class VRPCrossover : VRPOperator, IVRPCrossover {
    32     public ILookupParameter<ItemArray<IVRPEncoding>> ParentsParameter {
    33       get { return (ScopeTreeLookupParameter<IVRPEncoding>)Parameters["Parents"]; }
     32    public ILookupParameter<ItemArray<IVRPEncodedSolution>> ParentsParameter {
     33      get { return (ScopeTreeLookupParameter<IVRPEncodedSolution>)Parameters["Parents"]; }
    3434    }
    3535
    36     public ILookupParameter<IVRPEncoding> ChildParameter {
    37       get { return (ILookupParameter<IVRPEncoding>)Parameters["Child"]; }
     36    public ILookupParameter<IVRPEncodedSolution> ChildParameter {
     37      get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["Child"]; }
    3838    }
    3939
     
    4343    public VRPCrossover()
    4444      : base() {
    45       Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed."));
     45      Parameters.Add(new ScopeTreeLookupParameter<IVRPEncodedSolution>("Parents", "The parent permutations which should be crossed."));
    4646      ParentsParameter.ActualName = "VRPTours";
    47       Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover."));
     47      Parameters.Add(new LookupParameter<IVRPEncodedSolution>("Child", "The child permutation resulting from the crossover."));
    4848      ChildParameter.ActualName = "VRPTours";
    4949    }
Note: See TracChangeset for help on using the changeset viewer.