Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/13/12 17:14:53 (13 years ago)
Author:
ascheibe
Message:

#1864

  • switched IOperators collection to IItems
  • adapted algorithms and problems
  • added AfterDeserialization hooks for problem, external evaluation problem and user-defined problem
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  
    233233      ParameterizeStochasticOperator(Problem.SolutionCreator);
    234234      ParameterizeStochasticOperator(Problem.Evaluator);
    235       foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     235      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
    236236      foreach (ISingleObjectiveMoveEvaluator op in Problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) {
    237237        op.MoveQualityParameter.ActualNameChanged += new EventHandler(MoveEvaluator_MoveQualityParameter_ActualNameChanged);
     
    266266    }
    267267    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);
    269269      // This may seem pointless, but some operators already have the eventhandler registered, others don't
    270270      // FIXME: Is there another way to solve this problem?
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingImprovementOperator.cs

    r7259 r7999  
    316316      if (MoveGenerator != null) {
    317317        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))
    319319          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))
    321321          MoveEvaluatorParameter.ValidValues.Add(moveEvaluator);
    322322
Note: See TracChangeset for help on using the changeset viewer.