Changeset 3636 for trunk/sources/HeuristicLab.Algorithms.LocalSearch
- Timestamp:
- 05/05/10 14:52:19 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r3626 r3636 140 140 Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000))); 141 141 Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators.", new IntValue(100))); 142 Parameters.Add(new ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>("MoveAnalyzer", "The operator used to analyze the moves in each iteration.", new MultiAnalyzer<IPopulationAnalyzer>()));143 Parameters.Add(new ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>("Analyzer", "The operator used to analyze each iteration.", new MultiAnalyzer<ISolutionAnalyzer>()));142 Parameters.Add(new ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>("MoveAnalyzer", "The operator used to analyze the moves.", new MultiAnalyzer<IPopulationAnalyzer>())); 143 Parameters.Add(new ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>("Analyzer", "The operator used to analyze the solution.", new MultiAnalyzer<ISolutionAnalyzer>())); 144 144 145 145 RandomCreator randomCreator = new RandomCreator(); … … 229 229 ParameterizeMoveEvaluators(); 230 230 ParameterizeMoveMakers(); 231 ParameterizeAnalyzers(); 231 232 base.Problem_OperatorsChanged(sender, e); 232 233 } -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
r3621 r3636 104 104 Parameters.Add(new ValueLookupParameter<IOperator>("MoveEvaluator", "The operator that evaluates a move.")); 105 105 106 Parameters.Add(new ValueLookupParameter<IOperator>("MoveAnalyzer", "The operator used to analyze the moves in each iteration."));107 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each iteration."));106 Parameters.Add(new ValueLookupParameter<IOperator>("MoveAnalyzer", "The operator used to analyze the moves.")); 107 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution.")); 108 108 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied.")); 109 109 #endregion … … 111 111 #region Create operators 112 112 VariableCreator variableCreator = new VariableCreator(); 113 SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor(); 114 Assigner bestQualityInitializer = new Assigner(); 115 Placeholder analyzer1 = new Placeholder(); 113 116 ResultsCollector resultsCollector1 = new ResultsCollector(); 114 UniformSubScopesProcessor uniformSubScopesProcessor0 = new UniformSubScopesProcessor(); 115 Placeholder analyzer1 = new Placeholder(); 116 UniformSubScopesProcessor mainProcessor = new UniformSubScopesProcessor(); 117 SubScopesProcessor mainProcessor = new SubScopesProcessor(); 117 118 Placeholder moveGenerator = new Placeholder(); 118 119 UniformSubScopesProcessor moveEvaluationProcessor = new UniformSubScopesProcessor(); 119 120 Placeholder moveEvaluator = new Placeholder(); 121 IntCounter evaluatedMovesCounter = new IntCounter(); 120 122 Placeholder moveAnalyzer = new Placeholder(); 121 123 BestSelector bestSelector = new BestSelector(); 122 124 RightReducer rightReducer = new RightReducer(); 123 UniformSubScopesProcessor moveMakingProcessor = new UniformSubScopesProcessor();125 SubScopesProcessor moveMakingProcessor = new SubScopesProcessor(); 124 126 QualityComparator qualityComparator = new QualityComparator(); 125 127 ConditionalBranch improvesQualityBranch = new ConditionalBranch(); 126 128 Placeholder moveMaker = new Placeholder(); 129 Assigner bestQualityUpdater = new Assigner(); 127 130 SubScopesRemover subScopesRemover = new SubScopesRemover(); 128 131 IntCounter iterationsCounter = new IntCounter(); 129 132 Comparator iterationsComparator = new Comparator(); 133 SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor(); 134 Placeholder analyzer2 = new Placeholder(); 130 135 ResultsCollector resultsCollector2 = new ResultsCollector(); 131 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();132 Placeholder analyzer2 = new Placeholder();133 136 ConditionalBranch iterationsTermination = new ConditionalBranch(); 134 137 135 138 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); 136 137 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 138 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 139 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0))); 140 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0))); 141 142 bestQualityInitializer.Name = "Initialize BestQuality"; 143 bestQualityInitializer.LeftSideParameter.ActualName = "BestQuality"; 144 bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.Name; 139 145 140 146 analyzer1.Name = "Analyzer (placeholder)"; 141 147 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 142 148 143 mainProcessor.Name = "Solution processor (UniformSubScopesProcessor)"; 149 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 150 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 151 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 152 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 144 153 145 154 moveGenerator.Name = "MoveGenerator (placeholder)"; … … 148 157 moveEvaluator.Name = "MoveEvaluator (placeholder)"; 149 158 moveEvaluator.OperatorParameter.ActualName = MoveEvaluatorParameter.Name; 159 160 evaluatedMovesCounter.Name = "EvaluatedMoves + 1"; 161 evaluatedMovesCounter.ValueParameter.ActualName = "EvaluatedMoves"; 162 evaluatedMovesCounter.Increment = new IntValue(1); 150 163 151 164 moveAnalyzer.Name = "MoveAnalyzer (placeholder)"; … … 157 170 bestSelector.QualityParameter.ActualName = MoveQualityParameter.Name; 158 171 159 moveMakingProcessor.Name = "MoveMaking processor (UniformSubScopesProcessor)";160 161 172 qualityComparator.LeftSideParameter.ActualName = MoveQualityParameter.Name; 162 173 qualityComparator.RightSideParameter.ActualName = QualityParameter.Name; … … 167 178 moveMaker.Name = "MoveMaker (placeholder)"; 168 179 moveMaker.OperatorParameter.ActualName = MoveMakerParameter.Name; 180 181 bestQualityUpdater.Name = "Update BestQuality"; 182 bestQualityUpdater.LeftSideParameter.ActualName = "BestQuality"; 183 bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name; 169 184 170 185 subScopesRemover.RemoveAllSubScopes = true; … … 180 195 iterationsComparator.ResultParameter.ActualName = "Terminate"; 181 196 182 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));183 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;184 185 197 analyzer2.Name = "Analyzer (placeholder)"; 186 198 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 199 200 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations")); 201 resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 202 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves")); 203 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 187 204 188 205 iterationsTermination.Name = "Iterations Termination Condition"; … … 192 209 #region Create operator graph 193 210 OperatorGraph.InitialOperator = variableCreator; 194 variableCreator.Successor = resultsCollector1;195 resultsCollector1.Successor = uniformSubScopesProcessor0;196 uniformSubScopesProcessor0.Operator = analyzer1;197 uniformSubScopesProcessor0.Successor = mainProcessor;211 variableCreator.Successor = subScopesProcessor0; 212 subScopesProcessor0.Operators.Add(bestQualityInitializer); 213 subScopesProcessor0.Successor = resultsCollector1; 214 bestQualityInitializer.Successor = analyzer1; 198 215 analyzer1.Successor = null; 199 mainProcessor.Operator = moveGenerator; 216 resultsCollector1.Successor = mainProcessor; 217 mainProcessor.Operators.Add(moveGenerator); 200 218 mainProcessor.Successor = iterationsCounter; 201 219 moveGenerator.Successor = moveEvaluationProcessor; 202 220 moveEvaluationProcessor.Operator = moveEvaluator; 203 221 moveEvaluationProcessor.Successor = moveAnalyzer; 222 moveEvaluator.Successor = evaluatedMovesCounter; 223 evaluatedMovesCounter.Successor = null; 204 224 moveAnalyzer.Successor = bestSelector; 205 225 bestSelector.Successor = rightReducer; 206 226 rightReducer.Successor = moveMakingProcessor; 207 moveMakingProcessor.Operator = qualityComparator;227 moveMakingProcessor.Operators.Add(qualityComparator); 208 228 moveMakingProcessor.Successor = subScopesRemover; 209 229 subScopesRemover.Successor = null; … … 212 232 improvesQualityBranch.FalseBranch = null; 213 233 improvesQualityBranch.Successor = null; 214 moveMaker.Successor = null; 234 moveMaker.Successor = bestQualityUpdater; 235 bestQualityUpdater.Successor = null; 215 236 iterationsCounter.Successor = iterationsComparator; 216 iterationsComparator.Successor = resultsCollector2; 217 resultsCollector2.Successor = uniformSubScopesProcessor1; 218 uniformSubScopesProcessor1.Operator = analyzer2; 219 uniformSubScopesProcessor1.Successor = iterationsTermination; 237 iterationsComparator.Successor = subScopesProcessor1; 238 subScopesProcessor1.Operators.Add(analyzer2); 239 subScopesProcessor1.Successor = resultsCollector2; 220 240 analyzer2.Successor = null; 241 resultsCollector2.Successor = iterationsTermination; 221 242 iterationsTermination.TrueBranch = null; 222 243 iterationsTermination.FalseBranch = mainProcessor;
Note: See TracChangeset
for help on using the changeset viewer.