Changeset 3521 for trunk/sources/HeuristicLab.Algorithms.TabuSearch
- Timestamp:
- 04/24/10 17:07:51 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs
r3376 r3521 125 125 Placeholder visualizer1 = new Placeholder(); 126 126 ResultsCollector resultsCollector = new ResultsCollector(); 127 UniformSubScopesProcessor mainProcessor = new UniformSubScopesProcessor();127 SubScopesProcessor solutionProcessor = new SubScopesProcessor(); 128 128 Placeholder moveGenerator = new Placeholder(); 129 129 UniformSubScopesProcessor moveEvaluationProcessor = new UniformSubScopesProcessor(); … … 135 135 ConditionalBranch emptyNeighborhoodBranch1 = new ConditionalBranch(); 136 136 RightReducer rightReducer = new RightReducer(); 137 UniformSubScopesProcessor moveMakingProcessor = new UniformSubScopesProcessor();137 SubScopesProcessor moveMakingProcessor = new SubScopesProcessor(); 138 138 Placeholder tabuMaker = new Placeholder(); 139 139 Placeholder moveMaker = new Placeholder(); 140 DataTableValuesCollector valuesCollector = new DataTableValuesCollector(); 141 SubScopesRemover subScopesRemover1 = new SubScopesRemover(); 140 SubScopesRemover subScopesRemover = new SubScopesRemover(); 142 141 ConditionalBranch emptyNeighborhoodBranch2 = new ConditionalBranch(); 143 UniformSubScopesProcessor removeMoves = new UniformSubScopesProcessor();144 SubScopesRemover subScopesRemover2 = new SubScopesRemover();145 142 IntCounter iterationsCounter = new IntCounter(); 146 143 Comparator iterationsComparator = new Comparator(); … … 149 146 QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator(); 150 147 Placeholder visualizer2 = new Placeholder(); 148 DataTableValuesCollector valuesCollector = new DataTableValuesCollector(); 151 149 ConditionalBranch iterationsTermination = new ConditionalBranch(); 152 150 … … 155 153 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Average Move Quality", new DoubleValue(0))); 156 154 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Worst Move Quality", new DoubleValue(0))); 157 variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("MoveQualities", new DataTable("MoveQualities")));158 155 variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("EmptyNeighborhood", new BoolValue(false))); 156 variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("MoveQualities", new DataTable("Move Qualities", "Progress of the tabu search showing the best, average, and worst move found in each iteration."))); 159 157 160 158 bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality"; … … 173 171 visualizer1.Name = "Visualizer (placeholder)"; 174 172 visualizer1.OperatorParameter.ActualName = VisualizerParameter.Name; 175 173 176 174 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 177 175 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); … … 186 184 resultsCollector.ResultsParameter.ActualName = "Results"; 187 185 188 mainProcessor.Name = "Solution processor (UniformSubScopesProcessor)";189 190 186 moveGenerator.Name = "MoveGenerator (placeholder)"; 191 187 moveGenerator.OperatorParameter.ActualName = MoveGeneratorParameter.Name; … … 206 202 bestAverageWorstMoveQualityCalculator.WorstQualityParameter.ActualName = "Worst Move Quality"; 207 203 208 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Move Quality")); 209 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Average Move Quality")); 210 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Worst Move Quality")); 211 valuesCollector.DataTableParameter.ActualName = "MoveQualities"; 212 204 tabuSelector.AspirationParameter.Value = new BoolValue(true); 205 tabuSelector.BestQualityParameter.ActualName = "BestQuality"; 206 tabuSelector.CopySelected = new BoolValue(false); 207 tabuSelector.EmptyNeighborhoodParameter.ActualName = "EmptyNeighborhood"; 208 tabuSelector.MaximizationParameter.ActualName = MaximizationParameter.Name; 209 tabuSelector.MoveQualityParameter.ActualName = MoveQualityParameter.Name; 210 tabuSelector.MoveTabuParameter.ActualName = MoveTabuParameter.Name; 211 213 212 moveMakingProcessor.Name = "MoveMaking processor (UniformSubScopesProcessor)"; 214 213 … … 222 221 moveMaker.OperatorParameter.ActualName = MoveMakerParameter.Name; 223 222 224 subScopesRemover1.RemoveAllSubScopes = true; 225 226 emptyNeighborhoodBranch2.Name = "Neighborhood empty?"; 227 emptyNeighborhoodBranch2.ConditionParameter.ActualName = "EmptyNeighborhood"; 228 229 subScopesRemover2.RemoveAllSubScopes = true; 223 subScopesRemover.RemoveAllSubScopes = true; 230 224 231 225 iterationsCounter.Name = "Iterations Counter"; … … 254 248 visualizer2.Name = "Visualizer (placeholder)"; 255 249 visualizer2.OperatorParameter.ActualName = VisualizerParameter.Name; 250 251 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Move Quality")); 252 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Average Move Quality")); 253 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Worst Move Quality")); 254 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 255 valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 256 valuesCollector.DataTableParameter.ActualName = "MoveQualities"; 257 258 emptyNeighborhoodBranch2.Name = "Neighborhood empty?"; 259 emptyNeighborhoodBranch2.ConditionParameter.ActualName = "EmptyNeighborhood"; 256 260 257 261 iterationsTermination.Name = "Iterations Termination Condition"; … … 267 271 qualityDifferenceCalculator1.Successor = visualizer1; 268 272 visualizer1.Successor = resultsCollector; 269 resultsCollector.Successor = mainProcessor;270 mainProcessor.Operator = moveGenerator;271 mainProcessor.Successor = emptyNeighborhoodBranch2;273 resultsCollector.Successor = solutionProcessor; 274 solutionProcessor.Operators.Add(moveGenerator); 275 solutionProcessor.Successor = iterationsCounter; 272 276 moveGenerator.Successor = moveEvaluationProcessor; 273 277 moveEvaluationProcessor.Operator = moveEvaluator; … … 276 280 tabuChecker.Successor = null; 277 281 moveQualitySorter.Successor = bestAverageWorstMoveQualityCalculator; 278 bestAverageWorstMoveQualityCalculator.Successor = valuesCollector; 279 valuesCollector.Successor = tabuSelector; 282 bestAverageWorstMoveQualityCalculator.Successor = tabuSelector; 280 283 tabuSelector.Successor = emptyNeighborhoodBranch1; 281 284 emptyNeighborhoodBranch1.FalseBranch = rightReducer; 282 285 emptyNeighborhoodBranch1.TrueBranch = null; 283 emptyNeighborhoodBranch1.Successor = null;286 emptyNeighborhoodBranch1.Successor = subScopesRemover; 284 287 rightReducer.Successor = moveMakingProcessor; 285 moveMakingProcessor.Operator = tabuMaker;286 moveMakingProcessor.Successor = subScopesRemover1;288 moveMakingProcessor.Operators.Add(tabuMaker); 289 moveMakingProcessor.Successor = null; 287 290 tabuMaker.Successor = moveMaker; 288 291 moveMaker.Successor = null; 289 subScopesRemover1.Successor = null; 290 emptyNeighborhoodBranch2.FalseBranch = iterationsCounter; 291 emptyNeighborhoodBranch2.TrueBranch = removeMoves; 292 emptyNeighborhoodBranch2.Successor = null; 293 removeMoves.Operator = subScopesRemover2; 294 removeMoves.Successor = null; 295 subScopesRemover2.Successor = null; 292 subScopesRemover.Successor = null; 296 293 iterationsCounter.Successor = iterationsComparator; 297 294 iterationsComparator.Successor = bestQualityMemorizer3; … … 299 296 bestQualityMemorizer4.Successor = qualityDifferenceCalculator2; 300 297 qualityDifferenceCalculator2.Successor = visualizer2; 301 visualizer2.Successor = iterationsTermination; 298 visualizer2.Successor = valuesCollector; 299 valuesCollector.Successor = emptyNeighborhoodBranch2; 300 emptyNeighborhoodBranch2.TrueBranch = null; 301 emptyNeighborhoodBranch2.FalseBranch = iterationsTermination; 302 emptyNeighborhoodBranch2.Successor = null; 302 303 iterationsTermination.TrueBranch = null; 303 iterationsTermination.FalseBranch = mainProcessor;304 iterationsTermination.FalseBranch = solutionProcessor; 304 305 #endregion 305 306 } -
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSelector.cs
r3376 r3521 94 94 Parameters.Add(new SubScopesLookupParameter<BoolValue>("MoveTabu", "The tabu status of the move.")); 95 95 Parameters.Add(new ValueLookupParameter<BoolValue>("CopySelected", "True if the selected move should be copied.", new BoolValue(false))); 96 Parameters.Add(new LookupParameter<BoolValue>("EmptyNeighborhood", "Will be set to true if the neighborhood didn't contain any non-tabu moves . It is notset to false."));96 Parameters.Add(new LookupParameter<BoolValue>("EmptyNeighborhood", "Will be set to true if the neighborhood didn't contain any non-tabu moves, otherwise it is set to false.")); 97 97 } 98 98 … … 128 128 EmptyNeighborhoodParameter.ActualValue = new BoolValue(true); 129 129 selected[0] = new Scope("All moves are tabu."); 130 } 130 } else EmptyNeighborhoodParameter.ActualValue = new BoolValue(false); 131 131 132 132 // remove from last to first so that the stored indices remain the same
Note: See TracChangeset
for help on using the changeset viewer.