Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8351


Ignore:
Timestamp:
07/27/12 19:09:13 (12 years ago)
Author:
ascheibe
Message:

#1331 fixed algorithms that couldn't handle Items that they get now from the problem (I overlooked these two cases, all other algorithms/cases have been adapted in the course of ticket #1864)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs

    r8121 r8351  
    255255    }
    256256    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    257       foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     257      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
    258258      ParameterizeIterationBasedOperators();
    259259      UpdateCrossovers();
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs

    r8121 r8351  
    236236    }
    237237    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    238       foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     238      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
    239239      // This may seem pointless, but some operators already have the eventhandler registered, others don't
    240240      // FIXME: Is there another way to solve this problem?
Note: See TracChangeset for help on using the changeset viewer.