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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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();
Note: See TracChangeset for help on using the changeset viewer.