Changeset 7999 for trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing
- Timestamp:
- 06/13/12 17:14:53 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r7517 r7999 233 233 ParameterizeStochasticOperator(Problem.SolutionCreator); 234 234 ParameterizeStochasticOperator(Problem.Evaluator); 235 foreach (IOperator op in Problem.Operators ) ParameterizeStochasticOperator(op);235 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 236 236 foreach (ISingleObjectiveMoveEvaluator op in Problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) { 237 237 op.MoveQualityParameter.ActualNameChanged += new EventHandler(MoveEvaluator_MoveQualityParameter_ActualNameChanged); … … 266 266 } 267 267 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { 268 foreach (IOperator op in Problem.Operators ) ParameterizeStochasticOperator(op);268 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 269 269 // This may seem pointless, but some operators already have the eventhandler registered, others don't 270 270 // FIXME: Is there another way to solve this problem? -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingImprovementOperator.cs
r7259 r7999 316 316 if (MoveGenerator != null) { 317 317 IMoveGenerator generator = MoveGeneratorParameter.Value; 318 foreach (IMoveMaker moveMaker in MoveHelper.GetCompatibleMoveMakers(generator, Problem.Operators ).OrderBy(x => x.Name))318 foreach (IMoveMaker moveMaker in MoveHelper.GetCompatibleMoveMakers(generator, Problem.Operators.OfType<IOperator>()).OrderBy(x => x.Name)) 319 319 MoveMakerParameter.ValidValues.Add(moveMaker); 320 foreach (ISingleObjectiveMoveEvaluator moveEvaluator in MoveHelper.GetCompatibleSingleObjectiveMoveEvaluators(generator, Problem.Operators ).OrderBy(x => x.Name))320 foreach (ISingleObjectiveMoveEvaluator moveEvaluator in MoveHelper.GetCompatibleSingleObjectiveMoveEvaluators(generator, Problem.Operators.OfType<IOperator>()).OrderBy(x => x.Name)) 321 321 MoveEvaluatorParameter.ValidValues.Add(moveEvaluator); 322 322
Note: See TracChangeset
for help on using the changeset viewer.