Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/15 00:03:14 (9 years ago)
Author:
abeham
Message:

#2174:

  • Added IImprovmentOperator interface to SingleObjectiveImprover
  • Added Random parameter to Analyze method and IStochasticOperator interface to the resp. analyzer
  • Updated code template text of the compiled single- and multi-objective problem definitions
  • Prevent ProblemDefinitionScript from silently ignoring exceptions
  • Added equality comparer in Encoding's cloning constructor
  • Small adaption of ProblemDefinitionScriptView to changes in new code editor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/Encoding.cs

    r11753 r11880  
    5252        encodingOperators = new HashSet<IOperator>(value, new TypeEqualityComparer<IOperator>());
    5353
    54         T newSolutionCreator = (T)encodingOperators.FirstOrDefault(o => o.GetType() == solutionCreator.GetType());
    55         if (newSolutionCreator == null) newSolutionCreator = encodingOperators.OfType<T>().First();
     54        T newSolutionCreator = (T)encodingOperators.FirstOrDefault(o => o.GetType() == solutionCreator.GetType()) ??
     55                              encodingOperators.OfType<T>().First();
    5656        SolutionCreator = newSolutionCreator;
    5757        OnOperatorsChanged();
     
    8383    [StorableConstructor]
    8484    protected Encoding(bool deserializing) : base(deserializing) { }
    85 
    8685    protected Encoding(Encoding<T> original, Cloner cloner)
    8786      : base(original, cloner) {
    88       encodingOperators = new HashSet<IOperator>(original.Operators.Select(cloner.Clone));
     87      encodingOperators = new HashSet<IOperator>(original.Operators.Select(cloner.Clone), new TypeEqualityComparer<IOperator>());
    8988      solutionCreator = cloner.Clone(original.solutionCreator);
    9089    }
     
    9796    public void ConfigureOperator(IOperator @operator) { ConfigureOperators(new[] { @operator }); }
    9897    public abstract void ConfigureOperators(IEnumerable<IOperator> operators);
    99 
    10098
    10199    public event EventHandler SolutionCreatorChanged;
Note: See TracChangeset for help on using the changeset viewer.