Changeset 7727 for branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearchMainLoop.cs
- Timestamp:
- 04/13/12 18:42:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch/HeuristicLab.Algorithms.ScatterSearch/3.3/ScatterSearchMainLoop.cs
r7724 r7727 20 20 #endregion 21 21 22 using HeuristicLab.Algorithms.LocalSearch;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 74 73 get { return (LookupParameter<VariableCollection>)Parameters["Results"]; } 75 74 } 76 internal LookupParameter<IOperator> MoveEvaluatorParameter { 77 get { return (LookupParameter<IOperator>)Parameters["MoveEvaluator"]; } 78 } 79 internal LookupParameter<IOperator> MoveGeneratorParameter { 80 get { return (LookupParameter<IOperator>)Parameters["MoveGenerator"]; } 81 } 82 internal LookupParameter<IOperator> MoveMakerParameter { 83 get { return (LookupParameter<IOperator>)Parameters["MoveMaker"]; } 75 internal LookupParameter<ISingleObjectiveMoveEvaluator> MoveEvaluatorParameter { 76 get { return (LookupParameter<ISingleObjectiveMoveEvaluator>)Parameters["MoveEvaluator"]; } 77 } 78 internal LookupParameter<IMoveGenerator> MoveGeneratorParameter { 79 get { return (LookupParameter<IMoveGenerator>)Parameters["MoveGenerator"]; } 80 } 81 internal LookupParameter<IMoveMaker> MoveMakerParameter { 82 get { return (LookupParameter<IMoveMaker>)Parameters["MoveMaker"]; } 83 } 84 internal LookupParameter<IOperator> ImproverParameter { 85 get { return (LookupParameter<IOperator>)Parameters["Improver"]; } 86 } 87 internal LookupParameter<IOperator> EvaluatorParameter { 88 get { return (LookupParameter<IOperator>)Parameters["Evaluator"]; } 84 89 } 85 90 internal LookupParameter<IMultiAnalyzer> AnalyzerParameter { … … 137 142 set { ResultsParameter.ActualValue = value; } 138 143 } 139 public I Operator MoveEvaluator {144 public ISingleObjectiveMoveEvaluator MoveEvaluator { 140 145 get { return MoveEvaluatorParameter.ActualValue; } 141 146 set { MoveEvaluatorParameter.ActualValue = value; } 142 147 } 143 public I Operator MoveGenerator {148 public IMoveGenerator MoveGenerator { 144 149 get { return MoveGeneratorParameter.ActualValue; } 145 150 set { MoveGeneratorParameter.ActualValue = value; } 146 151 } 147 public I Operator MoveMaker {152 public IMoveMaker MoveMaker { 148 153 get { return MoveMakerParameter.ActualValue; } 149 154 set { MoveMakerParameter.ActualValue = value; } 155 } 156 public IOperator Improver { 157 get { return ImproverParameter.ActualValue; } 158 set { ImproverParameter.ActualValue = value; } 159 } 160 public IOperator Evaluator { 161 get { return EvaluatorParameter.ActualValue; } 162 set { EvaluatorParameter.ActualValue = value; } 150 163 } 151 164 public IMultiAnalyzer Analyzer { … … 178 191 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move.")); 179 192 Parameters.Add(new LookupParameter<IOperator>("SolutionCreator", "The operator which is used to create new solutions.")); 180 Parameters.Add(new LookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions. This operator is executed in parallel, if an engine is used which supports parallelization.")); 181 Parameters.Add(new LookupParameter<IOperator>("Improver", "The operator which is used to improve new solutions. This operator is executed in parallelm, if an engine is used which supports parallelization.")); 193 Parameters.Add(new LookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions.")); 182 194 Parameters.Add(new LookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 183 Parameters.Add(new LookupParameter<IOperator>("MoveGenerator", "The operator that generates the moves.")); 184 Parameters.Add(new LookupParameter<IOperator>("MoveMaker", "The operator that performs a move and updates the quality.")); 185 Parameters.Add(new LookupParameter<IOperator>("MoveEvaluator", "The operator that evaluates a move.")); 195 Parameters.Add(new LookupParameter<ISingleObjectiveMoveEvaluator>("MoveEvaluator", "The operator used to evaluate a move.")); 196 Parameters.Add(new LookupParameter<IMoveGenerator>("MoveGenerator", "The operator that generates the moves.")); 197 Parameters.Add(new LookupParameter<IMoveMaker>("MoveMaker", "The operator that performs a move and updates the quality.")); 198 Parameters.Add(new LookupParameter<IOperator>("Improver", "The operator used to improve solutions.")); 186 199 Parameters.Add(new LookupParameter<IMultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.")); 187 200 #endregion … … 195 208 ConditionalBranch terminateBranch = new ConditionalBranch(); 196 209 IntCounter interationsCounter = new IntCounter(); 197 LocalSearchImprovementOperator localImprovementOperator = new LocalSearchImprovementOperator();198 210 Placeholder analyzer = new Placeholder(); 199 Placeholder solutionImprover = new Placeholder(); 200 Placeholder solutionEvaluator = new Placeholder(); 211 Placeholder solutionEvaluator1 = new Placeholder(); 212 Placeholder solutionEvaluator2 = new Placeholder(); 213 Placeholder solutionImprover1 = new Placeholder(); 214 Placeholder solutionImprover2 = new Placeholder(); 201 215 PopulationRebuildMethod populationRebuildMethod = new PopulationRebuildMethod(); 202 216 ResultsCollector resultsCollector = new ResultsCollector(); … … 236 250 iterationsChecker.Successor = terminateBranch; 237 251 238 localImprovementOperator.Name = "ImprovementMethod"; 239 localImprovementOperator.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 240 localImprovementOperator.SampleSizeParameter.ActualName = SampleSizeParameter.Name; 241 localImprovementOperator.Successor = null; 252 solutionImprover2.Name = "SolutionImprover"; 253 solutionImprover2.OperatorParameter.ActualName = "Improver"; 254 solutionImprover2.Successor = solutionEvaluator2; 255 256 solutionEvaluator2.Name = "SolutionEvaluator"; 257 solutionEvaluator2.OperatorParameter.ActualName = "Evaluator"; 258 solutionEvaluator2.Successor = null; 242 259 243 260 newSolutionsBranch.Name = "NewSolutionChecker"; … … 261 278 analyzer.OperatorParameter.ActualName = "Analyzer"; 262 279 263 solutionImprover .Name = "SolutionImprover";264 solutionImprover .OperatorParameter.ActualName = "LocalImprovementOperator";265 solutionImprover .Successor = solutionEvaluator;266 267 solutionEvaluator .Name = "SolutionEvaluator";268 solutionEvaluator .OperatorParameter.ActualName = "Evaluator";269 solutionEvaluator .Successor = null;280 solutionImprover1.Name = "SolutionImprover"; 281 solutionImprover1.OperatorParameter.ActualName = "Improver"; 282 solutionImprover1.Successor = solutionEvaluator1; 283 284 solutionEvaluator1.Name = "SolutionEvaluator"; 285 solutionEvaluator1.OperatorParameter.ActualName = "Evaluator"; 286 solutionEvaluator1.Successor = null; 270 287 271 288 populationRebuildMethod.Successor = subScopesProcessor3; … … 308 325 309 326 uniformSubScopesProcessor2.DepthParameter.Value = new IntValue(1); 310 uniformSubScopesProcessor2.Operator = solutionImprover ;327 uniformSubScopesProcessor2.Operator = solutionImprover1; 311 328 uniformSubScopesProcessor2.Successor = null; 312 329 313 330 uniformSubScopesProcessor3.DepthParameter.Value = new IntValue(1); 314 uniformSubScopesProcessor3.Operator = localImprovementOperator;331 uniformSubScopesProcessor3.Operator = solutionImprover2; 315 332 uniformSubScopesProcessor3.Successor = null; 316 333 #endregion
Note: See TracChangeset
for help on using the changeset viewer.