Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/14/12 18:58:15 (12 years ago)
Author:
gkronber
Message:

#1847 merged r8205:8635 from trunk into branch

Location:
branches/GP-MoveOperators
Files:
15 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators

  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting

  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/Capacitated/BestCapacitatedVRPSolutionAnalyzer.cs

    r8053 r8660  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.Variants;
     32using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting {
     
    8788
    8889    public override IOperation Apply() {
     90      IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue;
    8991      ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue;
    9092      ResultCollection results = ResultsParameter.ActualValue;
     
    100102          results.Add(new Result("Best VRP Solution Overload", new DoubleValue(overloads[i].Value)));
    101103        } else {
    102           if (qualities[i].Value <= solution.Quality.Value) {
     104          VRPEvaluation eval = problemInstance.Evaluate(solution.Solution);
     105          if (qualities[i].Value <= eval.Quality) {
    103106            (results["Best VRP Solution Overload"].Value as DoubleValue).Value = overloads[i].Value;
    104107          }
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/PickupAndDelivery/BestPickupAndDeliveryVRPSolutionAnalyzer.cs

    r8053 r8660  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.Variants;
     32using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting {
     
    8788
    8889    public override IOperation Apply() {
     90      IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue;
    8991      ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue;
    9092      ResultCollection results = ResultsParameter.ActualValue;
     
    101103          results.Add(new Result("Best VRP Solution PickupViolations", new DoubleValue(pickupViolations[i].Value)));
    102104        } else {
    103           if (qualities[i].Value <= solution.Quality.Value) {
     105          VRPEvaluation eval = problemInstance.Evaluate(solution.Solution);
     106          if (qualities[i].Value <= eval.Quality) {
    104107            (results["Best VRP Solution PickupViolations"].Value as DoubleValue).Value = pickupViolations[i].Value;
    105108          }
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/TimeWindowed/BestTimeWindowedVRPSolutionAnalyzer.cs

    r8053 r8660  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.Variants;
     32using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting {
     
    9192
    9293    public override IOperation Apply() {
     94      IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue;
    9395      ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue;
    9496      ResultCollection results = ResultsParameter.ActualValue;
     
    106108          results.Add(new Result("Best VRP Solution TravelTime", new DoubleValue(travelTimes[i].Value)));
    107109        } else {
    108           if (qualities[i].Value <= solution.Quality.Value) {
     110          VRPEvaluation eval = problemInstance.Evaluate(solution.Solution);
     111          if (qualities[i].Value <= eval.Quality) {
    109112            (results["Best VRP Solution Tardiness"].Value as DoubleValue).Value = tardinesses[i].Value;
    110113            (results["Best VRP Solution TravelTime"].Value as DoubleValue).Value = travelTimes[i].Value;
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/Capacitated/CapacityRelaxationVRPAnalyzer.cs

    r8053 r8660  
    6060      get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; }
    6161    }
     62    public IValueParameter<DoubleValue> MaxPenaltyFactorParameter {
     63      get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; }
     64    }
    6265
    6366    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    8083      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Overload", "The overloads of the VRP solutions which should be analyzed."));
    8184
    82       Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.04)));
    83       Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.01)));
     85      Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.5)));
     86      Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.5)));
    8487      Parameters.Add(new ValueParameter<DoubleValue>("MinPenaltyFactor", "The minimum penalty factor.", new DoubleValue(0.01)));
     88      Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
    8589
    8690      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
     
    9599    }
    96100
     101    [StorableHook(HookType.AfterDeserialization)]
     102    private void AfterDeserialization() {
     103      // BackwardsCompatibility3.3
     104      #region Backwards compatible code, remove with 3.4
     105      if (!Parameters.ContainsKey("MaxPenaltyFactor")) {
     106        Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
     107      }
     108      #endregion
     109    }
     110
    97111    public override IOperation Apply() {
    98112      ICapacitatedProblemInstance cvrp = ProblemInstanceParameter.ActualValue as ICapacitatedProblemInstance;
     
    105119      double phi = PhiParameter.Value.Value;
    106120      double minPenalty = MinPenaltyFactorParameter.Value.Value;
     121      double maxPenalty = MaxPenaltyFactorParameter.Value.Value;
    107122
    108123      for (int j = 0; j < qualities.Length; j++) {
     
    124139      if (cvrp.OverloadPenalty.Value < minPenalty)
    125140        cvrp.OverloadPenalty.Value = minPenalty;
     141      if (cvrp.OverloadPenalty.Value > maxPenalty)
     142        cvrp.OverloadPenalty.Value = maxPenalty;
    126143
    127144      for (int j = 0; j < qualities.Length; j++) {
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/PickupAndDelivery/PickupViolationsRelaxationVRPAnalyzer.cs

    r8053 r8660  
    6060      get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; }
    6161    }
     62    public IValueParameter<DoubleValue> MaxPenaltyFactorParameter {
     63      get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; }
     64    }
    6265
    6366    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    8083      Parameters.Add(new ScopeTreeLookupParameter<IntValue>("PickupViolations", "The pickup violation of the VRP solutions which should be analyzed."));
    8184
    82       Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.04)));
    83       Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.01)));
     85      Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.5)));
     86      Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.5)));
    8487      Parameters.Add(new ValueParameter<DoubleValue>("MinPenaltyFactor", "The minimum penalty factor.", new DoubleValue(0.01)));
     88      Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
    8589
    8690      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
     
    9599    }
    96100
     101    [StorableHook(HookType.AfterDeserialization)]
     102    private void AfterDeserialization() {
     103      // BackwardsCompatibility3.3
     104      #region Backwards compatible code, remove with 3.4
     105      if (!Parameters.ContainsKey("MaxPenaltyFactor")) {
     106        Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
     107      }
     108      #endregion
     109    }
     110
    97111    public override IOperation Apply() {
    98112      IPickupAndDeliveryProblemInstance pdp = ProblemInstanceParameter.ActualValue as IPickupAndDeliveryProblemInstance;
     
    105119      double phi = PhiParameter.Value.Value;
    106120      double minPenalty = MinPenaltyFactorParameter.Value.Value;
     121      double maxPenalty = MaxPenaltyFactorParameter.Value.Value;
    107122
    108123      for (int j = 0; j < qualities.Length; j++) {
     
    124139      if (pdp.PickupViolationPenalty.Value < minPenalty)
    125140        pdp.PickupViolationPenalty.Value = minPenalty;
     141      if (pdp.PickupViolationPenalty.Value > maxPenalty)
     142        pdp.PickupViolationPenalty.Value = maxPenalty;
    126143
    127144      for (int j = 0; j < qualities.Length; j++) {
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/TimeWindowed/TimeWindowRelaxationVRPAnalyzer.cs

    r8053 r8660  
    6060      get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; }
    6161    }
     62    public IValueParameter<DoubleValue> MaxPenaltyFactorParameter {
     63      get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; }
     64    }
    6265
    6366    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    8083      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Tardiness", "The tardiness of the VRP solutions which should be analyzed."));
    8184
    82       Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.04)));
    83       Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.01)));
     85      Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.5)));
     86      Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.5)));
    8487      Parameters.Add(new ValueParameter<DoubleValue>("MinPenaltyFactor", "The minimum penalty factor.", new DoubleValue(0.01)));
     88      Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
    8589
    8690      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
     
    9599    }
    96100
     101    [StorableHook(HookType.AfterDeserialization)]
     102    private void AfterDeserialization() {
     103      // BackwardsCompatibility3.3
     104      #region Backwards compatible code, remove with 3.4
     105      if (!Parameters.ContainsKey("MaxPenaltyFactor")) {
     106        Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
     107      }
     108      #endregion
     109    }
     110
    97111    public override IOperation Apply() {
    98112      ITimeWindowedProblemInstance vrptw = ProblemInstanceParameter.ActualValue as ITimeWindowedProblemInstance;
     
    105119      double phi = PhiParameter.Value.Value;
    106120      double minPenalty = MinPenaltyFactorParameter.Value.Value;
     121      double maxPenalty = MaxPenaltyFactorParameter.Value.Value;
    107122
    108123      for (int j = 0; j < qualities.Length; j++) {
     
    124139      if (vrptw.TardinessPenalty.Value < minPenalty)
    125140        vrptw.TardinessPenalty.Value = minPenalty;
     141      if (vrptw.TardinessPenalty.Value > maxPenalty)
     142        vrptw.TardinessPenalty.Value = maxPenalty;
    126143
    127144      for (int j = 0; j < qualities.Length; j++) {
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinCrossover.cs

    r8053 r8660  
    6363    }
    6464
    65     protected Tour FindRoute(PotvinEncoding solution, int city) {
     65    protected static Tour FindRoute(PotvinEncoding solution, int city) {
    6666      Tour found = null;
    6767
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs

    r8053 r8660  
    2424using HeuristicLab.Encodings.PermutationEncoding;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2627
    2728namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
     
    4344    }
    4445
    45     protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
    46       bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
    47 
     46    public static PotvinEncoding Apply(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2, IVRPProblemInstance problemInstance, bool allowInfeasible) {
    4847      PotvinEncoding child = parent2.Clone() as PotvinEncoding;
    4948
     
    7574            child.Unrouted.Add(city);
    7675
    77         if (Repair(random, child, replacing, ProblemInstance, allowInfeasible) || allowInfeasible)
     76        if (Repair(random, child, replacing, problemInstance, allowInfeasible) || allowInfeasible)
    7877          return child;
    7978        else {
     
    8786      }
    8887    }
     88
     89    protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
     90      return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value);
     91    }
    8992  }
    9093}
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs

    r8053 r8660  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2526
    2627namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
     
    4243    }
    4344
    44     protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
    45       bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
    46 
     45    public static PotvinEncoding Apply(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2, IVRPProblemInstance problemInstance, bool allowInfeasible) {
    4746      PotvinEncoding child = parent1.Clone() as PotvinEncoding;
    4847      Tour newTour = new Tour();
    4948
    50       int cities = ProblemInstance.Cities.Value;
     49      int cities = problemInstance.Cities.Value;
    5150
    5251      if (cities > 0) {
     
    7776            child.Unrouted.Add(city);
    7877
    79         if (Repair(random, child, newTour, ProblemInstance, allowInfeasible) || allowInfeasible) {
     78        if (Repair(random, child, newTour, problemInstance, allowInfeasible) || allowInfeasible) {
    8079          return child;
    8180        } else {
     
    8988      }
    9089    }
     90
     91    protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) {
     92      return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value);
     93    }
    9194  }
    9295}
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseOneLevelExchangeManipulator.cs

    r8053 r8660  
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    29   [Item("PotvinPairwiseOneLevelExchangeMainpulator", "The 1M operator which manipulates a VRP representation.  It is implemented as described in Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172. It was adapted to the PDP formulation.")]
     29  [Item("PotvinPairwiseOneLevelExchangeMainpulator", "The 1M operator which manipulates a PDP representation. It has been adapted to pickup and delivery from Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172. It was adapted to the PDP formulation.")]
    3030  [StorableClass]
    3131  public sealed class PotvinPairwiseOneLevelExchangeMainpulator : PotvinManipulator {
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseTwoLevelExchangeManipulator.cs

    r8053 r8660  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    30   [Item("PotvinPairwiseTwoLevelExchangeManipulator", "The 2M operator which manipulates a VRP representation.  It is implemented as described in Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172.  It was adapted to the PDP formulation.")]
     30  [Item("PotvinPairwiseTwoLevelExchangeManipulator", "The 2M operator which manipulates a VRP representation.   It has been adapted to pickup and delivery from Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172.  It was adapted to the PDP formulation.")]
    3131  [StorableClass]
    3232  public sealed class PotvinPairwiseTwoLevelExchangeManipulator : PotvinManipulator {
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj

    r7923 r8660  
    7272    <OutputPath>..\..\bin\</OutputPath>
    7373    <DefineConstants>TRACE</DefineConstants>
    74     <DocumentationFile>bin\x86\Release\HeuristicLab.Routing.TSP-3.3.xml</DocumentationFile>
     74    <DocumentationFile>
     75    </DocumentationFile>
    7576    <Optimize>true</Optimize>
    7677    <DebugType>pdbonly</DebugType>
     
    139140    <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarMultiMoveGenerator.cs" />
    140141    <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarSingleMoveGenerator.cs" />
     142    <Compile Include="Improver\VRPImprovementOperator.cs" />
    141143    <Compile Include="Interfaces\IVRPLocalSearchManipulator.cs" />
    142144    <Compile Include="Interpreters\MDCVRPTWInterpreter.cs" />
     
    145147    <Compile Include="Interpreters\CVRPInterpreter.cs" />
    146148    <Compile Include="Interpreters\IVRPDataInterpreter.cs" />
     149    <Compile Include="PathRelinkers\VRPPathRelinker.cs" />
    147150    <Compile Include="Properties\AssemblyInfo.cs" />
    148151    <Compile Include="Encodings\Alba\AlbaEncoding.cs" />
     
    336339    <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPPDTW\CVRPPDTWEvaluator.cs" />
    337340    <Compile Include="ProblemInstances\SingleDepotVRP\SingleDepotVRPEvaluator.cs" />
     341    <Compile Include="SimilarityCalculators\VRPSimilarityCalculator.cs" />
    338342    <Compile Include="SolutionParser.cs" />
    339343    <Compile Include="Variants\Capacitated\Heterogenous\IHeterogenousCapacitatedProblemInstance.cs" />
     
    468472  -->
    469473  <PropertyGroup>
    470     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     474   <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    471475set ProjectDir=$(ProjectDir)
    472476set SolutionDir=$(SolutionDir)
     
    474478
    475479call PreBuildEvent.cmd</PreBuildEvent>
     480<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     481export ProjectDir=$(ProjectDir)
     482export SolutionDir=$(SolutionDir)
     483
     484$SolutionDir/PreBuildEvent.sh
     485</PreBuildEvent>
    476486  </PropertyGroup>
    477487  <PropertyGroup>
  • branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r8206 r8660  
    178178
    179179    private void AttachProblemInstanceEventHandlers() {
    180       var solutionCreatorParameter = SolutionCreatorParameter as ConstrainedValueParameter<IVRPCreator>;
    181       solutionCreatorParameter.ValidValues.Clear();
    182 
    183180      if (ProblemInstance != null) {
    184181        EvaluatorParameter.Value = ProblemInstance.SolutionEvaluator;
    185         IVRPCreator defaultCreator = null;
    186         foreach (IVRPCreator creator in Operators.Where(o => o is IVRPCreator)) {
    187           solutionCreatorParameter.ValidValues.Add(creator);
    188           if (creator is Encodings.Alba.RandomCreator)
    189             defaultCreator = creator;
    190         }
    191         if (defaultCreator != null)
    192           solutionCreatorParameter.Value = defaultCreator;
    193 
    194182        ProblemInstance.EvaluationChanged += new EventHandler(ProblemInstance_EvaluationChanged);
    195183      }
     
    246234
    247235    private void InitializeOperators() {
     236      var solutionCreatorParameter = SolutionCreatorParameter as ConstrainedValueParameter<IVRPCreator>;
     237      solutionCreatorParameter.ValidValues.Clear();
     238
    248239      Operators.Clear();
    249240
     
    252243        ProblemInstance.Operators.Concat(
    253244          ApplicationManager.Manager.GetInstances<IGeneralVRPOperator>().Cast<IOperator>()).OrderBy(op => op.Name));
     245        Operators.Add(new VRPSimilarityCalculator());
     246
     247        IVRPCreator defaultCreator = null;
     248        foreach (IVRPCreator creator in Operators.Where(o => o is IVRPCreator)) {
     249          solutionCreatorParameter.ValidValues.Add(creator);
     250          if (creator is Encodings.Alba.RandomCreator)
     251            defaultCreator = creator;
     252        }
     253        if (defaultCreator != null)
     254          solutionCreatorParameter.Value = defaultCreator;
    254255      }
    255256
     
    263264        }
    264265      }
    265     }
     266      if (ProblemInstance != null) {
     267        foreach (ISingleObjectiveImprovementOperator op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {
     268          op.SolutionParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
     269          op.SolutionParameter.Hidden = true;
     270        }
     271        foreach (ISingleObjectivePathRelinker op in Operators.OfType<ISingleObjectivePathRelinker>()) {
     272          op.ParentsParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
     273          op.ParentsParameter.Hidden = true;
     274        }
     275        foreach (VRPSimilarityCalculator op in Operators.OfType<VRPSimilarityCalculator>()) {
     276          op.SolutionVariableName = SolutionCreator.VRPToursParameter.ActualName;
     277          op.QualityVariableName = ProblemInstance.SolutionEvaluator.QualityParameter.ActualName;
     278          op.ProblemInstance = ProblemInstance;
     279        }
     280      }
     281    }
     282
    266283    #endregion
    267284
Note: See TracChangeset for help on using the changeset viewer.