Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/27/10 19:54:20 (14 years ago)
Author:
abeham
Message:

#1090

  • Fixed problem plugins reloading their operators on deserialization in following problems (forgot on them in the first commit)
    • SupportVectorRegressionProblem
    • SymbolicTimeSeriesPrognosisProblem
  • Fixed a bug in the FeatureSelectionProblem introduced in r4098
  • Fixed the issues mentioned in the code review of mkommend
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/SingleObjectiveSymbolicTimeSeriesPrognosisProblem.cs

    r4113 r4118  
    8585    #endregion
    8686
    87 
     87    [StorableConstructor]
     88    protected SingleObjectiveSymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { }
    8889    public SingleObjectiveSymbolicTimeSeriesPrognosisProblem()
    8990      : base() {
     
    9697      ParameterizeEvaluator();
    9798
    98       Initialize();
     99      InitializeOperators();
     100      AttachEventHandlers();
    99101    }
    100 
    101     [StorableConstructor]
    102     protected SingleObjectiveSymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { }
    103102
    104103    [StorableHook(HookType.AfterDeserialization)]
    105104    private void AfterDeserializationHook() {
    106       Initialize();
     105      AttachEventHandlers();
    107106    }
    108107
    109108    public override IDeepCloneable Clone(Cloner cloner) {
    110109      SingleObjectiveSymbolicTimeSeriesPrognosisProblem clone = (SingleObjectiveSymbolicTimeSeriesPrognosisProblem)base.Clone(cloner);
    111       clone.Initialize();
     110      clone.AttachEventHandlers();
    112111      return clone;
    113112    }
     
    135134
    136135    #region Helpers
    137     private void Initialize() {
    138       InitializeOperators();
     136    private void AttachEventHandlers() {
    139137    }
    140138
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/SymbolicTimeSeriesPrognosisProblem.cs

    r4113 r4118  
    122122      set { FunctionTreeGrammarParameter.Value = value; }
    123123    }
    124     private List<IOperator> operators;
    125124    public override IEnumerable<IOperator> Operators {
    126125      get { return operators; }
     
    157156    [Storable]
    158157    private SymbolicTimeSeriesPrognosisGrammar grammar;
    159 
     158    [Storable]
     159    private List<IOperator> operators;
     160
     161    [StorableConstructor]
     162    protected SymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { }
    160163    public SymbolicTimeSeriesPrognosisProblem()
    161164      : base() {
     
    179182
    180183      UpdateGrammar();
    181       Initialize();
    182     }
    183 
    184     [StorableConstructor]
    185     protected SymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { }
     184      InitializeOperators();
     185      RegisterParameterEvents();
     186      RegisterParameterValueEvents();
     187    }
    186188
    187189    [StorableHook(HookType.AfterDeserialization)]
    188190    private void AfterDeserializationHook() {
    189       Initialize();
     191      // BackwardsCompatibility3.3
     192      #region Backwards compatible code (remove with 3.4)
     193      if (operators == null) InitializeOperators();
     194      #endregion
     195      RegisterParameterEvents();
     196      RegisterParameterValueEvents();
    190197    }
    191198
    192199    public override IDeepCloneable Clone(Cloner cloner) {
    193200      SymbolicTimeSeriesPrognosisProblem clone = (SymbolicTimeSeriesPrognosisProblem)base.Clone(cloner);
     201      clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList();
    194202      clone.grammar = (SymbolicTimeSeriesPrognosisGrammar)cloner.Clone(grammar);
    195       clone.Initialize();
     203      clone.RegisterParameterEvents();
     204      clone.RegisterParameterValueEvents();
    196205      return clone;
    197206    }
     
    253262    protected void AddOperator(IOperator op) {
    254263      operators.Add(op);
    255     }
    256 
    257     private void Initialize() {
    258       InitializeOperators();
    259       RegisterParameterEvents();
    260       RegisterParameterValueEvents();
    261264    }
    262265
Note: See TracChangeset for help on using the changeset viewer.