- Timestamp:
- 05/03/12 10:51:24 (13 years ago)
- Location:
- branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/Knapsack/KnapsackMultipleGuidesPathRelinker.cs
r7775 r7778 79 79 80 80 protected override ItemArray<IItem> Relink(ItemArray<IItem> parents, PercentValue n) { 81 if (parents.Length !=2)82 throw new ArgumentException("The number of parents is not equal to2.");81 if (parents.Length < 2) 82 throw new ArgumentException("The number of parents is smaller than 2."); 83 83 return Apply(parents[0], parents.Skip(1).ToArray(), n); 84 84 } -
branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearchMainLoop.cs
r7775 r7778 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Selection; 30 31 31 32 namespace HeuristicLab.Algorithms.ScatterSearch { … … 199 200 ConditionalBranch terminateBranch = new ConditionalBranch(); 200 201 IntCounter interationsCounter = new IntCounter(); 202 MergingReducer mergingReducer = new MergingReducer(); 201 203 OffspringProcessor offspringProcessor = new OffspringProcessor(); 202 204 Placeholder analyzer = new Placeholder(); … … 209 211 ResultsCollector resultsCollector = new ResultsCollector(); 210 212 ReferenceSetUpdateMethod referenceSetUpdateMethod = new ReferenceSetUpdateMethod(); 213 RightSelector rightSelector = new RightSelector(); 211 214 SolutionPoolUpdateMethod solutionPoolUpdateMethod = new SolutionPoolUpdateMethod(); 212 215 SolutionsCreator solutionsCreator = new SolutionsCreator(); … … 267 270 interationsCounter.Successor = resultsCollector; 268 271 269 offspringProcessor.Successor = subScopesProcessor2; 272 offspringProcessor.Successor = rightSelector; 273 274 rightSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 275 rightSelector.CopySelected = new BoolValue(false); 276 rightSelector.Successor = subScopesProcessor2; 270 277 271 278 analyzer.Name = "Analyzer"; … … 307 314 subScopesProcessor2.DepthParameter.Value = new IntValue(1); 308 315 subScopesProcessor2.Operators.Add(new EmptyOperator()); 309 subScopesProcessor2.Operators.Add(new EmptyOperator());310 316 subScopesProcessor2.Operators.Add(uniformSubScopesProcessor2); 311 subScopesProcessor2.Successor = null;317 subScopesProcessor2.Successor = mergingReducer; 312 318 313 319 subScopesProcessor3.DepthParameter.Value = new IntValue(1); … … 320 326 uniformSubScopesProcessor1.Successor = solutionPoolUpdateMethod; 321 327 322 uniformSubScopesProcessor2.DepthParameter.Value = new IntValue( 1);328 uniformSubScopesProcessor2.DepthParameter.Value = new IntValue(2); 323 329 uniformSubScopesProcessor2.Operator = solutionImprover1; 324 330 uniformSubScopesProcessor2.Successor = null; -
branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/TravelingSalesman/TravelingSalesmanMultipleGuidesPathRelinker.cs
r7775 r7778 123 123 124 124 protected override ItemArray<IItem> Relink(ItemArray<IItem> parents, PercentValue n) { 125 if (parents.Length !=2)126 throw new ArgumentException("The number of parents is not equal to2.");125 if (parents.Length < 2) 126 throw new ArgumentException("The number of parents is smaller than 2."); 127 127 return Apply(parents[0], parents.Skip(1).ToArray(), DistanceMatrix, n); 128 128 }
Note: See TracChangeset
for help on using the changeset viewer.