Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 16:43:32 (9 years ago)
Author:
abeham
Message:

#2521: fixed recreation of programmable problem's encoding

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProgrammableProblem.cs

    r13350 r13365  
    7373      : base() {
    7474      Parameters.Add(new FixedValueParameter<SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>>("ProblemScript", "Defines the problem.",
    75         new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name, Encoding = Encoding }));
     75        new SingleObjectiveProblemDefinitionScript<TEncoding, TSolution>() { Name = Name }));
     76      ProblemScript.Encoding = Encoding = (TEncoding)Encoding.Clone();
    7677      Operators.Add(new BestScopeSolutionAnalyzer());
    7778      RegisterEvents();
     
    9091      Parameters.Remove("Maximization");
    9192      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
     93      var multiEnc = ProblemScript.Encoding as MultiEncoding;
     94      if (multiEnc != null) multiEnc.Clear();
    9295      ProblemScript.Initialize();
     96      Encoding = (TEncoding)ProblemScript.Encoding.Clone();
    9397
    9498      OnOperatorsChanged();
Note: See TracChangeset for help on using the changeset viewer.