- Timestamp:
- 09/14/12 18:58:15 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 15 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 8231,8246,8346,8455,8497,8600
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/Capacitated/BestCapacitatedVRPSolutionAnalyzer.cs
r8053 r8660 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.Variants; 32 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting { … … 87 88 88 89 public override IOperation Apply() { 90 IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue; 89 91 ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue; 90 92 ResultCollection results = ResultsParameter.ActualValue; … … 100 102 results.Add(new Result("Best VRP Solution Overload", new DoubleValue(overloads[i].Value))); 101 103 } else { 102 if (qualities[i].Value <= solution.Quality.Value) { 104 VRPEvaluation eval = problemInstance.Evaluate(solution.Solution); 105 if (qualities[i].Value <= eval.Quality) { 103 106 (results["Best VRP Solution Overload"].Value as DoubleValue).Value = overloads[i].Value; 104 107 } -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/PickupAndDelivery/BestPickupAndDeliveryVRPSolutionAnalyzer.cs
r8053 r8660 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.Variants; 32 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting { … … 87 88 88 89 public override IOperation Apply() { 90 IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue; 89 91 ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue; 90 92 ResultCollection results = ResultsParameter.ActualValue; … … 101 103 results.Add(new Result("Best VRP Solution PickupViolations", new DoubleValue(pickupViolations[i].Value))); 102 104 } else { 103 if (qualities[i].Value <= solution.Quality.Value) { 105 VRPEvaluation eval = problemInstance.Evaluate(solution.Solution); 106 if (qualities[i].Value <= eval.Quality) { 104 107 (results["Best VRP Solution PickupViolations"].Value as DoubleValue).Value = pickupViolations[i].Value; 105 108 } -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/TimeWindowed/BestTimeWindowedVRPSolutionAnalyzer.cs
r8053 r8660 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.Variants; 32 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting { … … 91 92 92 93 public override IOperation Apply() { 94 IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue; 93 95 ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue; 94 96 ResultCollection results = ResultsParameter.ActualValue; … … 106 108 results.Add(new Result("Best VRP Solution TravelTime", new DoubleValue(travelTimes[i].Value))); 107 109 } else { 108 if (qualities[i].Value <= solution.Quality.Value) { 110 VRPEvaluation eval = problemInstance.Evaluate(solution.Solution); 111 if (qualities[i].Value <= eval.Quality) { 109 112 (results["Best VRP Solution Tardiness"].Value as DoubleValue).Value = tardinesses[i].Value; 110 113 (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 60 60 get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; } 61 61 } 62 public IValueParameter<DoubleValue> MaxPenaltyFactorParameter { 63 get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; } 64 } 62 65 63 66 public ValueLookupParameter<ResultCollection> ResultsParameter { … … 80 83 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Overload", "The overloads of the VRP solutions which should be analyzed.")); 81 84 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))); 84 87 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))); 85 89 86 90 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored.")); … … 95 99 } 96 100 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 97 111 public override IOperation Apply() { 98 112 ICapacitatedProblemInstance cvrp = ProblemInstanceParameter.ActualValue as ICapacitatedProblemInstance; … … 105 119 double phi = PhiParameter.Value.Value; 106 120 double minPenalty = MinPenaltyFactorParameter.Value.Value; 121 double maxPenalty = MaxPenaltyFactorParameter.Value.Value; 107 122 108 123 for (int j = 0; j < qualities.Length; j++) { … … 124 139 if (cvrp.OverloadPenalty.Value < minPenalty) 125 140 cvrp.OverloadPenalty.Value = minPenalty; 141 if (cvrp.OverloadPenalty.Value > maxPenalty) 142 cvrp.OverloadPenalty.Value = maxPenalty; 126 143 127 144 for (int j = 0; j < qualities.Length; j++) { -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/PickupAndDelivery/PickupViolationsRelaxationVRPAnalyzer.cs
r8053 r8660 60 60 get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; } 61 61 } 62 public IValueParameter<DoubleValue> MaxPenaltyFactorParameter { 63 get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; } 64 } 62 65 63 66 public ValueLookupParameter<ResultCollection> ResultsParameter { … … 80 83 Parameters.Add(new ScopeTreeLookupParameter<IntValue>("PickupViolations", "The pickup violation of the VRP solutions which should be analyzed.")); 81 84 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))); 84 87 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))); 85 89 86 90 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored.")); … … 95 99 } 96 100 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 97 111 public override IOperation Apply() { 98 112 IPickupAndDeliveryProblemInstance pdp = ProblemInstanceParameter.ActualValue as IPickupAndDeliveryProblemInstance; … … 105 119 double phi = PhiParameter.Value.Value; 106 120 double minPenalty = MinPenaltyFactorParameter.Value.Value; 121 double maxPenalty = MaxPenaltyFactorParameter.Value.Value; 107 122 108 123 for (int j = 0; j < qualities.Length; j++) { … … 124 139 if (pdp.PickupViolationPenalty.Value < minPenalty) 125 140 pdp.PickupViolationPenalty.Value = minPenalty; 141 if (pdp.PickupViolationPenalty.Value > maxPenalty) 142 pdp.PickupViolationPenalty.Value = maxPenalty; 126 143 127 144 for (int j = 0; j < qualities.Length; j++) { -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/TimeWindowed/TimeWindowRelaxationVRPAnalyzer.cs
r8053 r8660 60 60 get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; } 61 61 } 62 public IValueParameter<DoubleValue> MaxPenaltyFactorParameter { 63 get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; } 64 } 62 65 63 66 public ValueLookupParameter<ResultCollection> ResultsParameter { … … 80 83 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Tardiness", "The tardiness of the VRP solutions which should be analyzed.")); 81 84 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))); 84 87 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))); 85 89 86 90 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored.")); … … 95 99 } 96 100 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 97 111 public override IOperation Apply() { 98 112 ITimeWindowedProblemInstance vrptw = ProblemInstanceParameter.ActualValue as ITimeWindowedProblemInstance; … … 105 119 double phi = PhiParameter.Value.Value; 106 120 double minPenalty = MinPenaltyFactorParameter.Value.Value; 121 double maxPenalty = MaxPenaltyFactorParameter.Value.Value; 107 122 108 123 for (int j = 0; j < qualities.Length; j++) { … … 124 139 if (vrptw.TardinessPenalty.Value < minPenalty) 125 140 vrptw.TardinessPenalty.Value = minPenalty; 141 if (vrptw.TardinessPenalty.Value > maxPenalty) 142 vrptw.TardinessPenalty.Value = maxPenalty; 126 143 127 144 for (int j = 0; j < qualities.Length; j++) { -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinCrossover.cs
r8053 r8660 63 63 } 64 64 65 protected Tour FindRoute(PotvinEncoding solution, int city) {65 protected static Tour FindRoute(PotvinEncoding solution, int city) { 66 66 Tour found = null; 67 67 -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
r8053 r8660 24 24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 26 27 27 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 43 44 } 44 45 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) { 48 47 PotvinEncoding child = parent2.Clone() as PotvinEncoding; 49 48 … … 75 74 child.Unrouted.Add(city); 76 75 77 if (Repair(random, child, replacing, ProblemInstance, allowInfeasible) || allowInfeasible)76 if (Repair(random, child, replacing, problemInstance, allowInfeasible) || allowInfeasible) 78 77 return child; 79 78 else { … … 87 86 } 88 87 } 88 89 protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) { 90 return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value); 91 } 89 92 } 90 93 } -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
r8053 r8660 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Problems.VehicleRouting.Interfaces; 25 26 26 27 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 42 43 } 43 44 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) { 47 46 PotvinEncoding child = parent1.Clone() as PotvinEncoding; 48 47 Tour newTour = new Tour(); 49 48 50 int cities = ProblemInstance.Cities.Value;49 int cities = problemInstance.Cities.Value; 51 50 52 51 if (cities > 0) { … … 77 76 child.Unrouted.Add(city); 78 77 79 if (Repair(random, child, newTour, ProblemInstance, allowInfeasible) || allowInfeasible) {78 if (Repair(random, child, newTour, problemInstance, allowInfeasible) || allowInfeasible) { 80 79 return child; 81 80 } else { … … 89 88 } 90 89 } 90 91 protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) { 92 return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value); 93 } 91 94 } 92 95 } -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseOneLevelExchangeManipulator.cs
r8053 r8660 27 27 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 29 [Item("PotvinPairwiseOneLevelExchangeMainpulator", "The 1M operator which manipulates a VRP representation. It is implemented as described inPotvin, 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.")] 30 30 [StorableClass] 31 31 public sealed class PotvinPairwiseOneLevelExchangeMainpulator : PotvinManipulator { -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseTwoLevelExchangeManipulator.cs
r8053 r8660 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 30 [Item("PotvinPairwiseTwoLevelExchangeManipulator", "The 2M operator which manipulates a VRP representation. It is implemented as described inPotvin, 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.")] 31 31 [StorableClass] 32 32 public sealed class PotvinPairwiseTwoLevelExchangeManipulator : PotvinManipulator { -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r7923 r8660 72 72 <OutputPath>..\..\bin\</OutputPath> 73 73 <DefineConstants>TRACE</DefineConstants> 74 <DocumentationFile>bin\x86\Release\HeuristicLab.Routing.TSP-3.3.xml</DocumentationFile> 74 <DocumentationFile> 75 </DocumentationFile> 75 76 <Optimize>true</Optimize> 76 77 <DebugType>pdbonly</DebugType> … … 139 140 <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarMultiMoveGenerator.cs" /> 140 141 <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarSingleMoveGenerator.cs" /> 142 <Compile Include="Improver\VRPImprovementOperator.cs" /> 141 143 <Compile Include="Interfaces\IVRPLocalSearchManipulator.cs" /> 142 144 <Compile Include="Interpreters\MDCVRPTWInterpreter.cs" /> … … 145 147 <Compile Include="Interpreters\CVRPInterpreter.cs" /> 146 148 <Compile Include="Interpreters\IVRPDataInterpreter.cs" /> 149 <Compile Include="PathRelinkers\VRPPathRelinker.cs" /> 147 150 <Compile Include="Properties\AssemblyInfo.cs" /> 148 151 <Compile Include="Encodings\Alba\AlbaEncoding.cs" /> … … 336 339 <Compile Include="ProblemInstances\SingleDepotVRP\CVRP\CVRPTW\CVRPPDTW\CVRPPDTWEvaluator.cs" /> 337 340 <Compile Include="ProblemInstances\SingleDepotVRP\SingleDepotVRPEvaluator.cs" /> 341 <Compile Include="SimilarityCalculators\VRPSimilarityCalculator.cs" /> 338 342 <Compile Include="SolutionParser.cs" /> 339 343 <Compile Include="Variants\Capacitated\Heterogenous\IHeterogenousCapacitatedProblemInstance.cs" /> … … 468 472 --> 469 473 <PropertyGroup> 470 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)474 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 471 475 set ProjectDir=$(ProjectDir) 472 476 set SolutionDir=$(SolutionDir) … … 474 478 475 479 call PreBuildEvent.cmd</PreBuildEvent> 480 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 481 export ProjectDir=$(ProjectDir) 482 export SolutionDir=$(SolutionDir) 483 484 $SolutionDir/PreBuildEvent.sh 485 </PreBuildEvent> 476 486 </PropertyGroup> 477 487 <PropertyGroup> -
branches/GP-MoveOperators/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r8206 r8660 178 178 179 179 private void AttachProblemInstanceEventHandlers() { 180 var solutionCreatorParameter = SolutionCreatorParameter as ConstrainedValueParameter<IVRPCreator>;181 solutionCreatorParameter.ValidValues.Clear();182 183 180 if (ProblemInstance != null) { 184 181 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 194 182 ProblemInstance.EvaluationChanged += new EventHandler(ProblemInstance_EvaluationChanged); 195 183 } … … 246 234 247 235 private void InitializeOperators() { 236 var solutionCreatorParameter = SolutionCreatorParameter as ConstrainedValueParameter<IVRPCreator>; 237 solutionCreatorParameter.ValidValues.Clear(); 238 248 239 Operators.Clear(); 249 240 … … 252 243 ProblemInstance.Operators.Concat( 253 244 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; 254 255 } 255 256 … … 263 264 } 264 265 } 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 266 283 #endregion 267 284
Note: See TracChangeset
for help on using the changeset viewer.