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
Files:
8 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    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisBoundedEvaluator.cs

    r5495 r5509  
    2424using HeuristicLab.Data;
    2525namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    26   public interface ISymbolicDataAnalysisBoundedEvaluator : ISymbolicDataAnalysisEvaluator {
     26  public interface ISymbolicDataAnalysisBoundedEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>
     27   where T : class, IDataAnalysisProblemData {
    2728    IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { get; }
    2829    IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { get; }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisEvaluator.cs

    r5500 r5509  
    2323using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    25   public interface ISymbolicDataAnalysisEvaluator : IDataAnalysisEvaluator {
     25  public interface ISymbolicDataAnalysisEvaluator<T> : IDataAnalysisEvaluator<T>
     26   where T : class, IDataAnalysisProblemData {
    2627    ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
    2728    IValueLookupParameter<IntValue> SamplesStartParameter { get; }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveEvaluator.cs

    r5498 r5509  
    2525
    2626namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    27   public interface ISymbolicDataAnalysisMultiObjectiveEvaluator : ISymbolicDataAnalysisEvaluator, IMultiObjectiveEvaluator {
     27  public interface ISymbolicDataAnalysisMultiObjectiveEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>, IMultiObjectiveEvaluator
     28   where T : class, IDataAnalysisProblemData {
    2829    IEnumerable<bool> Maximization { get; }
    2930  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveEvaluator.cs

    r5498 r5509  
    2323using HeuristicLab.Optimization;
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    25   public interface ISymbolicDataAnalysisSingleObjectiveEvaluator : ISymbolicDataAnalysisEvaluator, ISingleObjectiveEvaluator {
     25  public interface ISymbolicDataAnalysisSingleObjectiveEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>, ISingleObjectiveEvaluator
     26   where T : class, IDataAnalysisProblemData {
    2627    bool Maximization { get; }
    2728  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolutionCreator.cs

    r5495 r5509  
    2222using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2323namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    24   public interface ISymbolicDataAnalysisSolutionCreator : ISymbolicExpressionTreeCreator {
     24  public interface ISymbolicDataAnalysisSolutionCreator<T> : ISymbolicExpressionTreeCreator, IDataAnalysisSolutionCreator<T>
     25  where T : class, IDataAnalysisProblemData {
    2526  }
    2627}
Note: See TracChangeset for help on using the changeset viewer.