Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/05/18 18:52:05 (6 years ago)
Author:
bburlacu
Message:

#2958: Add EvaluatedSolutions as parameter, similar to the other interpreters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs

    r16276 r16277  
    2626using HeuristicLab.Common;
    2727using HeuristicLab.Core;
     28using HeuristicLab.Data;
    2829using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     30using HeuristicLab.Parameters;
    2931using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3032
     
    3335  [Item("SymbolicDataAnalysisExpressionTreeNativeInterpreter", "An interpreter that wraps a native dll")]
    3436  public class SymbolicDataAnalysisExpressionTreeNativeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
    35     public int EvaluatedSolutions { get; set; }
     37    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
     38
     39    #region parameters
     40    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
     41      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
     42    }
     43    #endregion
     44
     45    #region properties
     46    public int EvaluatedSolutions {
     47      get { return EvaluatedSolutionsParameter.Value.Value; }
     48      set { EvaluatedSolutionsParameter.Value.Value = value; }
     49    }
     50    #endregion
    3651
    3752    public void ClearState() { }
    3853
    39     public SymbolicDataAnalysisExpressionTreeNativeInterpreter() { }
     54    public SymbolicDataAnalysisExpressionTreeNativeInterpreter() {
     55      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
     56    }
    4057
    4158    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.