Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/05/15 10:19:37 (9 years ago)
Author:
abeham
Message:

#2174:

  • Removed compilation calls from the problem (AfterDeserialization and in cloning constructor) and instead compile instance lazily when accessed
  • Compile support code in ExternalEvaluationProblem lazy
  • Fixed encoding class names in template code files (forgot to add vector)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblem.cs

    r11899 r11900  
    7979    [StorableConstructor]
    8080    private ExternalEvaluationProblem(bool deserializing) : base(deserializing) { }
    81     private ExternalEvaluationProblem(ExternalEvaluationProblem original, Cloner cloner)
    82       : base(original, cloner) {
    83       CompileSupportScript();
    84     }
     81    private ExternalEvaluationProblem(ExternalEvaluationProblem original, Cloner cloner) : base(original, cloner) { }
    8582    public override IDeepCloneable Clone(Cloner cloner) {
    8683      return new ExternalEvaluationProblem(this, cloner);
     
    9289      Parameters.Add(new ValueParameter<SolutionMessageBuilder>("MessageBuilder", "The message builder that converts from HeuristicLab objects to SolutionMessage representation.", new SolutionMessageBuilder()));
    9390      Parameters.Add(new FixedValueParameter<SingleObjectiveOptimizationSupportScript>("SupportScript", "A script that can provide neighborhood and analyze the results of the optimization.", new SingleObjectiveOptimizationSupportScript()));
    94       CompileSupportScript();
    95     }
    96 
    97     [StorableHook(HookType.AfterDeserialization)]
    98     private void AfterDeserialization() {
    99       CompileSupportScript();
    100     }
    101 
    102     private void CompileSupportScript() {
    103       try {
    104         OptimizationSupportScript.Compile();
    105       } catch (SingleObjectiveOptimizationSupportException ex) {
    106         PluginInfrastructure.ErrorHandling.ShowErrorDialog("Support script doesn't compile.", ex);
    107       }
    10891    }
    10992
Note: See TracChangeset for help on using the changeset viewer.