Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/29/09 13:43:16 (15 years ago)
Author:
mkommend
Message:

corrected bug in AlgortihmBase.Model. model was created for every call which results in duplicate variables in the bestvalidationsolutionscope => exception.
therefore a caching mechanism was implemented. (ticket #712)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.GP.StructureIdentification/3.3/AlgorithmBase.cs

    r2201 r2206  
    7373    }
    7474
     75    private IModel model;
    7576    public virtual IModel Model {
    7677      get {
    7778        if (!engine.Terminated) throw new InvalidOperationException("The algorithm is still running. Wait until the algorithm is terminated to retrieve the result.");
    78         IScope bestModelScope = engine.GlobalScope.GetVariableValue<IScope>("BestValidationSolution", false);
    79         return CreateGPModel(bestModelScope);
     79        if (model == null) {
     80          IScope bestModelScope = engine.GlobalScope.GetVariableValue<IScope>("BestValidationSolution", false);
     81          model = CreateGPModel(bestModelScope);
     82        }
     83        return model;
    8084      }
    8185    }
Note: See TracChangeset for help on using the changeset viewer.