Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/19/12 11:16:51 (12 years ago)
Author:
abeham
Message:

#1985: Updated branch from trunk

Location:
branches/RuntimeOptimizer
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/RuntimeOptimizer

  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs

    r8838 r9078  
    2828using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2929using HeuristicLab.Operators;
     30using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
    3132using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3536  [StorableClass]
    3637  public abstract class SymbolicDataAnalysisEvaluator<T> : SingleSuccessorOperator,
    37     ISymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
     38    ISymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator, IStochasticOperator
    3839  where T : class, IDataAnalysisProblemData {
    3940    private const string RandomParameterName = "Random";
     
    5051
    5152    #region parameter properties
     53    ILookupParameter<IRandom> IStochasticOperator.RandomParameter {
     54      get { return RandomParameter; }
     55    }
     56
    5257    public IValueLookupParameter<IRandom> RandomParameter {
    5358      get { return (IValueLookupParameter<IRandom>)Parameters[RandomParameterName]; }
     
    145150      double lowerEstimationLimit, double upperEstimationLimit,
    146151      IOnlineCalculator calculator, int maxRows) {
    147       if (cache == null || cache.GetLength(0) < maxRows) {
     152      if (cache == null || cache.Length < maxRows) {
    148153        cache = new double[maxRows];
    149154      }
    150155
    151156      // calculate linear scaling
    152       // the static methods of the calculator are not used because the evaluated values should be cached for performance reasons
    153157      int i = 0;
    154158      var linearScalingCalculator = new OnlineLinearScalingParameterCalculator();
  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisProblem.cs

    r7259 r9078  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Data;
     24using HeuristicLab.Optimization;
    2425
    2526namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    26   public interface ISymbolicDataAnalysisProblem : IDataAnalysisProblem {
     27  public interface ISymbolicDataAnalysisProblem : IDataAnalysisProblem, IHeuristicOptimizationProblem {
    2728    IValueParameter<ISymbolicDataAnalysisGrammar> SymbolicExpressionTreeGrammarParameter { get; }
    2829    IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { get; }
     
    4546    IntRange ValidationPartition { get; }
    4647  }
     48
     49  public interface ISymbolicDataAnalysisSingleObjectiveProblem : ISymbolicDataAnalysisProblem, ISingleObjectiveHeuristicOptimizationProblem { }
     50  public interface ISymbolicDataAnalysisMultiObjectiveProblem : ISymbolicDataAnalysisProblem, IMultiObjectiveHeuristicOptimizationProblem { }
    4751}
  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r8486 r9078  
    9999        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
    100100
    101       EvaluatedSolutions.Value++; // increment the evaluated solutions counter
     101      lock (EvaluatedSolutions) {
     102        EvaluatedSolutions.Value++; // increment the evaluated solutions counter
     103      }
    102104      var state = PrepareInterpreterState(tree, dataset);
    103105
     
    109111    }
    110112
    111     private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {
     113    private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {
    112114      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
    113115      int necessaryArgStackSize = 0;
  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs

    r8664 r9078  
    6969
    7070    #region Scaling
    71     public static void Scale(ISymbolicDataAnalysisModel model, IDataAnalysisProblemData problemData, string targetVariable) {
     71    protected void Scale(IDataAnalysisProblemData problemData, string targetVariable) {
    7272      var dataset = problemData.Dataset;
    7373      var rows = problemData.TrainingIndices;
    74       var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows);
     74      var estimatedValues = Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
    7575      var targetValues = dataset.GetDoubleValues(targetVariable, rows);
    7676
     
    9494      ConstantTreeNode betaTreeNode = null;
    9595      // check if model has been scaled previously by analyzing the structure of the tree
    96       var startNode = model.SymbolicExpressionTree.Root.GetSubtree(0);
     96      var startNode = SymbolicExpressionTree.Root.GetSubtree(0);
    9797      if (startNode.GetSubtree(0).Symbol is Addition) {
    9898        var addNode = startNode.GetSubtree(0);
  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs

    r7259 r9078  
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3131  [StorableClass]
    32   public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, IMultiObjectiveHeuristicOptimizationProblem
     32  public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisMultiObjectiveProblem
    3333    where T : class,IDataAnalysisProblemData
    3434    where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
  • branches/RuntimeOptimizer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSingleObjectiveProblem.cs

    r7259 r9078  
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3232  [StorableClass]
    33   public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISingleObjectiveHeuristicOptimizationProblem
     33  public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisSingleObjectiveProblem
    3434    where T : class,IDataAnalysisProblemData
    3535    where U : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<T>
Note: See TracChangeset for help on using the changeset viewer.