Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/11 13:22:49 (14 years ago)
Author:
mkommend
Message:

#1418: Made evaluators and problems generic to create the parameters correctly.

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs

    r5500 r5509  
    3333
    3434namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    35   public abstract class SymbolicDataAnalysisEvaluator : SingleSuccessorOperator,
    36     ISymbolicDataAnalysisEvaluator, ISymbolicDataAnalysisBoundedEvaluator, ISymbolicDataAnalysisInterpreterOperator {
     35  public abstract class SymbolicDataAnalysisEvaluator<T> : SingleSuccessorOperator,
     36    ISymbolicDataAnalysisBoundedEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator
     37  where T : class, IDataAnalysisProblemData {
    3738    private const string RandomParameterName = "Random";
    3839    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
     
    5556      get { return (ILookupParameter<ISymbolicDataAnalysisTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
    5657    }
    57     public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
    58       get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
     58    public ILookupParameter<T> ProblemDataParameter {
     59      get { return (ILookupParameter<T>)Parameters[ProblemDataParameterName]; }
    5960    }
    6061
     
    7980
    8081    #region properties
    81     public IDataAnalysisProblemData ProblemData {
     82    public T ProblemData {
    8283      get { return ProblemDataParameter.ActualValue; }
    8384    }
     
    102103    [StorableConstructor]
    103104    protected SymbolicDataAnalysisEvaluator(bool deserializing) : base(deserializing) { }
    104     protected SymbolicDataAnalysisEvaluator(SymbolicDataAnalysisEvaluator original, Cloner cloner)
     105    protected SymbolicDataAnalysisEvaluator(SymbolicDataAnalysisEvaluator<T> original, Cloner cloner)
    105106      : base(original, cloner) {
    106107    }
     
    108109      : base() {
    109110      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
    110       Parameters.Add(new LookupParameter<ISymbolicDataAnalysisTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
    111       Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeInterpreterParameterName, "The symbolic regression solution encoded as a symbolic expression tree."));
    112       Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName, "The problem data on which the symbolic regression solution should be evaluated."));
    113       Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated."));
    114       Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated."));
    115       Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
    116       Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
     111      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
     112      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeInterpreterParameterName, "The symbolic data analysis solution encoded as a symbolic expression tree."));
     113      Parameters.Add(new LookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
     114      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
     115      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
     116      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic data analysis trees."));
     117      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic data analysis trees."));
    117118      Parameters.Add(new ValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.", new PercentValue(1)));
    118119    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisMultiObjectiveEvaluator.cs

    r5507 r5509  
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    30   public abstract class SymbolicDataAnalysisMultiObjectiveEvaluator : SymbolicDataAnalysisEvaluator, ISymbolicDataAnalysisMultiObjectiveEvaluator {
     30  public abstract class SymbolicDataAnalysisMultiObjectiveEvaluator<T> : SymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
     31   where T : class, IDataAnalysisProblemData {
    3132    private const string QualitiesParameterName = "Qualities";
    3233    public ILookupParameter<DoubleArray> QualitiesParameter {
     
    3839    [StorableConstructor]
    3940    protected SymbolicDataAnalysisMultiObjectiveEvaluator(bool deserializing) : base(deserializing) { }
    40     protected SymbolicDataAnalysisMultiObjectiveEvaluator(SymbolicDataAnalysisMultiObjectiveEvaluator original, Cloner cloner)
     41    protected SymbolicDataAnalysisMultiObjectiveEvaluator(SymbolicDataAnalysisMultiObjectiveEvaluator<T> original, Cloner cloner)
    4142      : base(original, cloner) {
    4243    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisSingleObjectiveEvaluator.cs

    r5500 r5509  
    2727
    2828namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    29   public abstract class SymbolicDataAnalysisSingleObjectiveEvaluator : SymbolicDataAnalysisEvaluator, ISymbolicDataAnalysisSingleObjectiveEvaluator {
     29  public abstract class SymbolicDataAnalysisSingleObjectiveEvaluator<T> : SymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisSingleObjectiveEvaluator<T>
     30   where T : class, IDataAnalysisProblemData {
    3031    private const string QualityParameterName = "Quality";
    3132    public ILookupParameter<DoubleValue> QualityParameter {
     
    3738    [StorableConstructor]
    3839    protected SymbolicDataAnalysisSingleObjectiveEvaluator(bool deserializing) : base(deserializing) { }
    39     protected SymbolicDataAnalysisSingleObjectiveEvaluator(SymbolicDataAnalysisSingleObjectiveEvaluator original, Cloner cloner)
     40    protected SymbolicDataAnalysisSingleObjectiveEvaluator(SymbolicDataAnalysisSingleObjectiveEvaluator<T> original, Cloner cloner)
    4041      : base(original, cloner) {
    4142    }
Note: See TracChangeset for help on using the changeset viewer.