Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/31/14 13:38:42 (11 years ago)
Author:
mkommend
Message:

#1837: Corrected project files and merged trunk changes to the sliding window branch.

Location:
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic
Files:
13 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs

    r9708 r10681  
    7575    public static Allele[] CalculateAlleles(ISymbolicExpressionTree solution, int alleleTreedepth) {
    7676      return GetAllSubtreesOfDepth(solution, alleleTreedepth)
    77         .AsParallel()
    7877        .Select(t => GetAlleleFromSubtreeOfDepth(t, alleleTreedepth))
    7978        .ToArray();
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs

    r9708 r10681  
    121121
    122122      var qualities = tree
    123         .AsParallel()
    124123        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
    125124        .ToArray();
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs

    r10429 r10681  
    55using HeuristicLab.Core;
    66using HeuristicLab.Data;
    7 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    8 using HeuristicLab.Optimization;
     7using HeuristicLab.Operators;
     8using HeuristicLab.Optimization.Operators;
    99using HeuristicLab.Parameters;
    1010using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    1414  [Item("SymbolicDataAnalysisSingleObjectivePruningAnalyzer", "An analyzer that prunes introns from trees in single objective symbolic data analysis problems.")]
    1515  public abstract class SymbolicDataAnalysisSingleObjectivePruningAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer {
     16    #region parameter names
    1617    private const string ProblemDataParameterName = "ProblemData";
    17     private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
    18 
    1918    private const string UpdateIntervalParameterName = "UpdateInverval";
    2019    private const string UpdateCounterParameterName = "UpdateCounter";
    21 
    2220    private const string PopulationSliceParameterName = "PopulationSlice";
    2321    private const string PruningProbabilityParameterName = "PruningProbability";
    24 
    25     private const string NumberOfPrunedSubtreesParameterName = "PrunedSubtrees";
    26     private const string NumberOfPrunedTreesParameterName = "PrunedTrees";
    27 
     22    private const string TotalNumberOfPrunedSubtreesParameterName = "Number of pruned subtrees";
     23    private const string TotalNumberOfPrunedTreesParameterName = "Number of pruned trees";
    2824    private const string RandomParameterName = "Random";
    29     private const string EstimationLimitsParameterName = "EstimationLimits";
    30 
    3125    private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes";
    3226    private const string NodeImpactThresholdParameterName = "ImpactThreshold";
    33 
    34     private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
    35 
    36     private bool reentry;
    37     [Storable]
    38     protected ISymbolicDataAnalysisSolutionImpactValuesCalculator impactValuesCalculator;
    39 
     27    private const string PruningOperatorParameterName = "PruningOperator";
     28    private const string ResultsParameterName = "Results";
     29    #endregion
     30    #region private members
     31    private DataReducer prunedSubtreesReducer;
     32    private DataReducer prunedTreesReducer;
     33    private DataTableValuesCollector valuesCollector;
     34    private ResultsCollector resultsCollector;
     35    private EmptyOperator emptyOp;
     36    #endregion
    4037    #region parameter properties
     38    public IValueParameter<SymbolicDataAnalysisExpressionPruningOperator> PruningOperatorParameter {
     39      get { return (IValueParameter<SymbolicDataAnalysisExpressionPruningOperator>)Parameters[PruningOperatorParameterName]; }
     40    }
    4141    public IFixedValueParameter<BoolValue> PruneOnlyZeroImpactNodesParameter {
    4242      get { return (IFixedValueParameter<BoolValue>)Parameters[PruneOnlyZeroImpactNodesParameterName]; }
     
    4545      get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; }
    4646    }
    47     public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
    48       get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
    49     }
    5047    public ILookupParameter<IRandom> RandomParameter {
    5148      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
     
    5350    private ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
    5451      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
    55     }
    56     public ILookupParameter<IntRange> FitnessCalculationPartitionParameter {
    57       get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
    58     }
    59     private ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
    60       get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
    6152    }
    6253    public IValueParameter<IntValue> UpdateIntervalParameter {
     
    7263      get { return (IValueParameter<DoubleValue>)Parameters[PruningProbabilityParameterName]; }
    7364    }
    74     public IFixedValueParameter<DoubleValue> NumberOfPrunedSubtreesParameter {
    75       get { return (IFixedValueParameter<DoubleValue>)Parameters[NumberOfPrunedSubtreesParameterName]; }
    76     }
    77     public IFixedValueParameter<DoubleValue> NumberOfPrunedTreesParameter {
    78       get { return (IFixedValueParameter<DoubleValue>)Parameters[NumberOfPrunedTreesParameterName]; }
    79     }
    8065    #endregion
    8166    #region properties
     67    protected SymbolicDataAnalysisExpressionPruningOperator PruningOperator { get { return PruningOperatorParameter.Value; } }
    8268    protected IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } }
    83     protected IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } }
    84     protected ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } }
    8569    protected IntValue UpdateInterval { get { return UpdateIntervalParameter.Value; } }
    8670    protected IntValue UpdateCounter { get { return UpdateCounterParameter.Value; } }
    8771    protected DoubleRange PopulationSlice { get { return PopulationSliceParameter.Value; } }
    8872    protected DoubleValue PruningProbability { get { return PruningProbabilityParameter.Value; } }
    89     protected DoubleValue PrunedSubtrees { get { return NumberOfPrunedSubtreesParameter.Value; } }
    90     protected DoubleValue PrunedTrees { get { return NumberOfPrunedTreesParameter.Value; } }
    91     protected DoubleLimit EstimationLimits { get { return EstimationLimitsParameter.ActualValue; } }
    9273    protected IRandom Random { get { return RandomParameter.ActualValue; } }
    9374    protected DoubleValue NodeImpactThreshold { get { return NodeImpactThresholdParameter.Value; } }
    9475    protected BoolValue PruneOnlyZeroImpactNodes { get { return PruneOnlyZeroImpactNodesParameter.Value; } }
    9576    #endregion
    96 
    9777    #region IStatefulItem members
    9878    public override void InitializeState() {
    9979      base.InitializeState();
    10080      UpdateCounter.Value = 0;
    101       PrunedSubtrees.Value = 0;
    102       PrunedTrees.Value = 0;
    10381    }
    10482    public override void ClearState() {
    10583      base.ClearState();
    10684      UpdateCounter.Value = 0;
    107       PrunedSubtrees.Value = 0;
    108       PrunedTrees.Value = 0;
    10985    }
    11086    #endregion
     
    11288    [StorableConstructor]
    11389    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(bool deserializing) : base(deserializing) { }
    114     [StorableHook(HookType.AfterDeserialization)]
    115     private void AfterDeserialization() {
    116       if (!Parameters.ContainsKey(FitnessCalculationPartitionParameterName))
    117         Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, ""));
    118     }
    11990    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner)
    12091      : base(original, cloner) {
    121       impactValuesCalculator = original.impactValuesCalculator;
     92      if (original.prunedSubtreesReducer != null)
     93        this.prunedSubtreesReducer = (DataReducer)original.prunedSubtreesReducer.Clone();
     94      if (original.prunedTreesReducer != null)
     95        this.prunedTreesReducer = (DataReducer)original.prunedTreesReducer.Clone();
     96      if (original.valuesCollector != null)
     97        this.valuesCollector = (DataTableValuesCollector)original.valuesCollector.Clone();
     98      if (original.resultsCollector != null)
     99        this.resultsCollector = (ResultsCollector)original.resultsCollector.Clone();
    122100    }
    123101    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer() {
     102      #region add parameters
    124103      Parameters.Add(new ValueParameter<DoubleRange>(PopulationSliceParameterName, new DoubleRange(0.75, 1)));
    125104      Parameters.Add(new ValueParameter<DoubleValue>(PruningProbabilityParameterName, new DoubleValue(0.5)));
    126       // analyzer parameters
    127105      Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1)));
    128106      Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called", new IntValue(0)));
    129107      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName));
    130108      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
    131       Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
    132 
    133       Parameters.Add(new FixedValueParameter<DoubleValue>(NumberOfPrunedSubtreesParameterName, new DoubleValue(0)));
    134       Parameters.Add(new FixedValueParameter<DoubleValue>(NumberOfPrunedTreesParameterName, new DoubleValue(0)));
    135       Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
    136109      Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, new DoubleValue(0.0)));
    137110      Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, new BoolValue(false)));
    138       Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, ""));
     111      #endregion
     112    }
     113
     114    private void InitializeOperators() {
     115      prunedSubtreesReducer = new DataReducer();
     116      prunedSubtreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedSubtreesParameter.ActualName;
     117      prunedSubtreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); // sum all the pruned subtrees parameter values
     118      prunedSubtreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter
     119      prunedSubtreesReducer.TargetParameter.ActualName = TotalNumberOfPrunedSubtreesParameterName;
     120
     121      prunedTreesReducer = new DataReducer();
     122      prunedTreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedTreesParameter.ActualName;
     123      prunedTreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
     124      prunedTreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign);
     125      prunedTreesReducer.TargetParameter.ActualName = TotalNumberOfPrunedTreesParameterName;
     126
     127      valuesCollector = new DataTableValuesCollector();
     128      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedSubtreesParameterName));
     129      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedTreesParameterName));
     130      valuesCollector.DataTableParameter.ActualName = "Population pruning";
     131
     132      resultsCollector = new ResultsCollector();
     133      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Population pruning"));
     134      resultsCollector.ResultsParameter.ActualName = ResultsParameterName;
     135
     136      emptyOp = new EmptyOperator();
     137    }
     138
     139    //
     140    /// <summary>
     141    /// Computes the closed interval bounding the portion of the population that is to be pruned.
     142    /// </summary>
     143    /// <returns>Returns an int range [start, end]</returns>
     144    private IntRange GetSliceBounds() {
     145      var count = ExecutionContext.Scope.SubScopes.Count;
     146      var start = (int)Math.Round(PopulationSlice.Start * count);
     147      var end = (int)Math.Round(PopulationSlice.End * count);
     148      if (end > count) end = count;
     149
     150      if (start >= end) throw new ArgumentOutOfRangeException("Invalid PopulationSlice bounds.");
     151      return new IntRange(start, end);
     152    }
     153
     154    private IOperation CreatePruningOperation() {
     155      var oc = new OperationCollection { Parallel = true };
     156      var range = GetSliceBounds();
     157      var qualities = Quality.Select(x => x.Value).ToArray();
     158      var indices = Enumerable.Range(0, qualities.Length).ToArray();
     159      Array.Sort(qualities, indices);
     160      if (!Maximization.Value) Array.Reverse(indices);
     161
     162      var subscopes = ExecutionContext.Scope.SubScopes;
     163
     164      for (int i = 0; i < subscopes.Count; ++i) {
     165        IOperator op;
     166        if (range.Start <= i && i < range.End && Random.NextDouble() <= PruningProbability.Value)
     167          op = PruningOperator;
     168        else op = emptyOp;
     169        var index = indices[i];
     170        var subscope = subscopes[index];
     171        oc.Add(ExecutionContext.CreateChildOperation(op, subscope));
     172      }
     173      return oc;
    139174    }
    140175
    141176    public override IOperation Apply() {
    142       if (reentry) {
    143         UpdateCounter.Value++;
     177      UpdateCounter.Value++;
     178      if (UpdateCounter.Value != UpdateInterval.Value) return base.Apply();
     179      UpdateCounter.Value = 0;
    144180
    145         if (UpdateCounter.Value != UpdateInterval.Value) return base.Apply();
    146         UpdateCounter.Value = 0;
     181      if (prunedSubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); }
    147182
    148         var trees = SymbolicExpressionTreeParameter.ActualValue.ToList();
    149         var qualities = QualityParameter.ActualValue.ToList();
     183      var prune = CreatePruningOperation();
     184      var reducePrunedSubtrees = ExecutionContext.CreateChildOperation(prunedSubtreesReducer);
     185      var reducePrunedTrees = ExecutionContext.CreateChildOperation(prunedTreesReducer);
     186      var collectValues = ExecutionContext.CreateChildOperation(valuesCollector);
     187      var collectResults = ExecutionContext.CreateChildOperation(resultsCollector);
    150188
    151         var population = trees.Zip(qualities, (tree, quality) => new { Tree = tree, Quality = quality }).ToList();
    152         Func<double, double, int> compare = (a, b) => Maximization.Value ? a.CompareTo(b) : b.CompareTo(a);
    153         population.Sort((a, b) => compare(a.Quality.Value, b.Quality.Value));
    154 
    155         var start = (int)Math.Round(PopulationSlice.Start * trees.Count);
    156         var end = (int)Math.Round(PopulationSlice.End * trees.Count);
    157 
    158         if (end == population.Count) end--;
    159 
    160         if (start >= end || end >= population.Count) throw new Exception("Invalid PopulationSlice bounds.");
    161 
    162         PrunedSubtrees.Value = 0;
    163         PrunedTrees.Value = 0;
    164 
    165         reentry = false;
    166 
    167         var operations = new OperationCollection { Parallel = true };
    168         foreach (var p in population.Skip(start).Take(end)) {
    169           if (Random.NextDouble() > PruningProbability.Value) continue;
    170           var op = new SymbolicDataAnalysisExpressionPruningOperator {
    171             Model = CreateModel(p.Tree, Interpreter, EstimationLimits.Lower, EstimationLimits.Upper),
    172             ImpactsCalculator = impactValuesCalculator,
    173             ProblemData = ProblemData,
    174             Random = Random,
    175             PruneOnlyZeroImpactNodes = PruneOnlyZeroImpactNodes.Value,
    176             NodeImpactThreshold = NodeImpactThreshold.Value,
    177             FitnessCalculationPartition = FitnessCalculationPartition
    178           };
    179           operations.Add(ExecutionContext.CreateChildOperation(op, ExecutionContext.Scope));
    180         }
    181         return new OperationCollection { operations, ExecutionContext.CreateOperation(this) };
    182       }
    183 
    184       DataTable table;
    185 
    186       if (ResultCollection.ContainsKey("Population Pruning")) {
    187         table = (DataTable)ResultCollection["Population Pruning"].Value;
    188       } else {
    189         table = new DataTable("Population Pruning");
    190         table.Rows.Add(new DataRow("Pruned Trees") { VisualProperties = { StartIndexZero = true } });
    191         table.Rows.Add(new DataRow("Pruned Subtrees") { VisualProperties = { StartIndexZero = true } });
    192         ResultCollection.Add(new Result("Population Pruning", table));
    193       }
    194 
    195       table.Rows["Pruned Trees"].Values.Add(PrunedTrees.Value);
    196       table.Rows["Pruned Subtrees"].Values.Add(PrunedSubtrees.Value);
    197 
    198       reentry = true;
    199 
    200       return base.Apply();
     189      return new OperationCollection { prune, reducePrunedSubtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() };
    201190    }
    202 
    203     protected abstract ISymbolicDataAnalysisModel CreateModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
    204       double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue);
    205191  }
    206192}
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs

    r9708 r10681  
    3535  [Item("SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    3636  [StorableClass]
    37   public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer
     37  public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, IIterationBasedOperator
     38
    3839    where T : class, ISymbolicDataAnalysisSolution {
    3940    private const string TrainingBestSolutionParameterName = "Best training solution";
    4041    private const string TrainingBestSolutionQualityParameterName = "Best training solution quality";
     42    private const string TrainingBestSolutionGenerationParameterName = "Best training solution generation";
    4143    private const string UpdateAlwaysParameterName = "Always update best solution";
     44    private const string IterationsParameterName = "Iterations";
     45    private const string MaximumIterationsParameterName = "Maximum Iterations";
    4246
    4347    #region parameter properties
     
    4852      get { return (ILookupParameter<DoubleValue>)Parameters[TrainingBestSolutionQualityParameterName]; }
    4953    }
     54    public ILookupParameter<IntValue> TrainingBestSolutionGenerationParameter {
     55      get { return (ILookupParameter<IntValue>)Parameters[TrainingBestSolutionGenerationParameterName]; }
     56    }
    5057    public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
    5158      get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
     59    }
     60    public ILookupParameter<IntValue> IterationsParameter {
     61      get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
     62    }
     63    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
     64      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
    5265    }
    5366    #endregion
     
    7386      Parameters.Add(new LookupParameter<T>(TrainingBestSolutionParameterName, "The training best symbolic data analyis solution."));
    7487      Parameters.Add(new LookupParameter<DoubleValue>(TrainingBestSolutionQualityParameterName, "The quality of the training best symbolic data analysis solution."));
     88      Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found."));
    7589      Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solution should always be updated regardless of its quality.", new BoolValue(false)));
     90      Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
     91      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
    7692      UpdateAlwaysParameter.Hidden = true;
    7793    }
     
    8399        UpdateAlwaysParameter.Hidden = true;
    84100      }
     101      if (!Parameters.ContainsKey(TrainingBestSolutionGenerationParameterName))
     102        Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found."));
     103      if (!Parameters.ContainsKey(IterationsParameterName))
     104        Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
     105      if (!Parameters.ContainsKey(MaximumIterationsParameterName))
     106        Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
    85107    }
    86108
     
    104126        TrainingBestSolution = CreateSolution(bestTree, bestQuality);
    105127        TrainingBestSolutionQuality = new DoubleValue(bestQuality);
     128        if (IterationsParameter.ActualValue != null)
     129          TrainingBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
    106130
    107131        if (!results.ContainsKey(TrainingBestSolutionParameter.Name)) {
    108132          results.Add(new Result(TrainingBestSolutionParameter.Name, TrainingBestSolutionParameter.Description, TrainingBestSolution));
    109133          results.Add(new Result(TrainingBestSolutionQualityParameter.Name, TrainingBestSolutionQualityParameter.Description, TrainingBestSolutionQuality));
     134          if (TrainingBestSolutionGenerationParameter.ActualValue != null)
     135            results.Add(new Result(TrainingBestSolutionGenerationParameter.Name, TrainingBestSolutionGenerationParameter.Description, TrainingBestSolutionGenerationParameter.ActualValue));
    110136        } else {
    111137          results[TrainingBestSolutionParameter.Name].Value = TrainingBestSolution;
    112138          results[TrainingBestSolutionQualityParameter.Name].Value = TrainingBestSolutionQuality;
     139          if (TrainingBestSolutionGenerationParameter.ActualValue != null)
     140            results[TrainingBestSolutionGenerationParameter.Name].Value = TrainingBestSolutionGenerationParameter.ActualValue;
     141
    113142        }
    114143      }
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs

    r9708 r10681  
    3737  [Item("SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    3838  [StorableClass]
    39   public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>
     39  public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, IIterationBasedOperator
    4040    where S : class, ISymbolicDataAnalysisSolution
    4141    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
     
    4343    private const string ValidationBestSolutionParameterName = "Best validation solution";
    4444    private const string ValidationBestSolutionQualityParameterName = "Best validation solution quality";
     45    private const string ValidationBestSolutionGenerationParameterName = "Best validation solution generation";
    4546    private const string UpdateAlwaysParameterName = "Always update best solution";
     47    private const string IterationsParameterName = "Iterations";
     48    private const string MaximumIterationsParameterName = "Maximum Iterations";
    4649
    4750    #region parameter properties
     
    5255      get { return (ILookupParameter<DoubleValue>)Parameters[ValidationBestSolutionQualityParameterName]; }
    5356    }
     57    public ILookupParameter<IntValue> ValidationBestSolutionGenerationParameter {
     58      get { return (ILookupParameter<IntValue>)Parameters[ValidationBestSolutionGenerationParameterName]; }
     59    }
    5460    public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
    5561      get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
     62    }
     63    public ILookupParameter<IntValue> IterationsParameter {
     64      get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
     65    }
     66    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
     67      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
    5668    }
    5769    #endregion
     
    7789      Parameters.Add(new LookupParameter<S>(ValidationBestSolutionParameterName, "The validation best symbolic data analyis solution."));
    7890      Parameters.Add(new LookupParameter<DoubleValue>(ValidationBestSolutionQualityParameterName, "The quality of the validation best symbolic data analysis solution."));
     91      Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found."));
    7992      Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(false)));
     93      Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
     94      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
    8095      UpdateAlwaysParameter.Hidden = true;
    8196    }
     
    8499    private void AfterDeserialization() {
    85100      if (!Parameters.ContainsKey(UpdateAlwaysParameterName)) {
    86         Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solution should always be updated regardless of its quality.", new BoolValue(false)));
     101        Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(false)));
    87102        UpdateAlwaysParameter.Hidden = true;
    88103      }
     104      if (!Parameters.ContainsKey(ValidationBestSolutionGenerationParameterName))
     105        Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found."));
     106      if (!Parameters.ContainsKey(IterationsParameterName))
     107        Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
     108      if (!Parameters.ContainsKey(MaximumIterationsParameterName))
     109        Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
    89110    }
    90111
     
    121142      var quality = tree
    122143        .Take(topN)
    123         .AsParallel()
    124144        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
    125145        .ToArray();
     
    138158        ValidationBestSolution = CreateSolution(bestTree, bestValidationQuality);
    139159        ValidationBestSolutionQuality = new DoubleValue(bestValidationQuality);
     160        if (IterationsParameter.ActualValue != null)
     161          ValidationBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
    140162
    141163        if (!results.ContainsKey(ValidationBestSolutionParameter.Name)) {
    142164          results.Add(new Result(ValidationBestSolutionParameter.Name, ValidationBestSolutionParameter.Description, ValidationBestSolution));
    143165          results.Add(new Result(ValidationBestSolutionQualityParameter.Name, ValidationBestSolutionQualityParameter.Description, ValidationBestSolutionQuality));
     166          if (ValidationBestSolutionGenerationParameter.ActualValue != null)
     167            results.Add(new Result(ValidationBestSolutionGenerationParameter.Name, ValidationBestSolutionGenerationParameter.Description, ValidationBestSolutionGenerationParameter.ActualValue));
    144168        } else {
    145169          results[ValidationBestSolutionParameter.Name].Value = ValidationBestSolution;
    146170          results[ValidationBestSolutionQualityParameter.Name].Value = ValidationBestSolutionQuality;
     171          if (ValidationBestSolutionGenerationParameter.ActualValue != null)
     172            results[ValidationBestSolutionGenerationParameter.Name].Value = ValidationBestSolutionGenerationParameter.ActualValue;
    147173        }
    148174      }
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs

    r9708 r10681  
    120120        .Select(i => tree[i])
    121121        .Take(topN)
    122         .AsParallel()
    123122        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
    124123        .ToArray();
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs

    r9708 r10681  
    131131
    132132      var variableFrequencies = trees
    133         .AsParallel()
    134133        .SelectMany(t => GetVariableReferences(t, aggregateLaggedVariables))
    135134        .GroupBy(pair => pair.Key, pair => pair.Value)
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r10403 r10681  
    125125      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
    126126    </Reference>
     127    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     128      <SpecificVersion>False</SpecificVersion>
     129      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
     130      <Private>False</Private>
     131    </Reference>
    127132    <Reference Include="HeuristicLab.Parameters-3.3">
    128133      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     
    177182      <SubType>Code</SubType>
    178183    </Compile>
     184    <Compile Include="Matching\SymbolicExpressionTreeCanonicalSorter.cs" />
     185    <Compile Include="Matching\SymbolicExpressionTreeEqualityComparer.cs" />
     186    <Compile Include="Matching\SymbolicExpressionTreeMatching.cs" />
     187    <Compile Include="Matching\SymbolicExpressionTreeMaxCommonSequenceCalculator.cs" />
     188    <Compile Include="Matching\SymbolicExpressionTreeNodeComparer.cs" />
     189    <Compile Include="Matching\SymbolicExpressionTreeNodeSimilarityComparer.cs" />
    179190    <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" />
    180191    <Compile Include="Analyzers\SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs" />
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs

    r9126 r10681  
    11using System.Collections.Generic;
     2using HeuristicLab.Core;
    23using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    34
    45namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    5   public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator {
     6  public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator : IItem {
    67    double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows);
    78    double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN);
     9    void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData,
     10      IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN);
    811  }
    912}
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame

    r10364 r10681  
    3838  [PluginDependency("HeuristicLab.Operators", "3.3")]
    3939  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     40  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
    4041  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    4142  [PluginDependency("HeuristicLab.Persistence", "3.3")]
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs

    r10429 r10681  
    3434  [StorableClass]
    3535  [Item("SymbolicExpressionTreePruningOperator", "An operator that replaces introns with constant values in a symbolic expression tree.")]
    36   public class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator {
    37     private const string NumberOfPrunedSubtreesParameterName = "PrunedSubtrees";
    38     private const string NumberOfPrunedTreesParameterName = "PrunedTrees";
     36  public abstract class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator {
     37    #region parameter names
     38    private const string ProblemDataParameterName = "ProblemData";
     39    private const string SymbolicDataAnalysisModelParameterName = "SymbolicDataAnalysisModel";
     40    private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";
     41    private const string PrunedSubtreesParameterName = "PrunedSubtrees";
     42    private const string PrunedTreesParameterName = "PrunedTrees";
     43    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
     44    private const string NodeImpactThresholdParameterName = "ImpactThreshold";
     45    private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes";
     46    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; // the tree to be pruned
     47    private const string QualityParameterName = "Quality"; // the quality
     48    private const string EstimationLimitsParameterName = "EstimationLimits";
     49    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
     50    #endregion
     51
    3952    #region parameter properties
    40     public ILookupParameter<DoubleValue> NumberOfPrunedSubtreesParameter {
    41       get { return (ILookupParameter<DoubleValue>)Parameters[NumberOfPrunedSubtreesParameterName]; }
     53    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
     54      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    4255    }
    43     public ILookupParameter<DoubleValue> NumberOfPrunedTreesParameter {
    44       get { return (ILookupParameter<DoubleValue>)Parameters[NumberOfPrunedTreesParameterName]; }
     56    public ILookupParameter<DoubleValue> QualityParameter {
     57      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
     58    }
     59    public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
     60      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
     61    }
     62    public IValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator> ImpactValuesCalculatorParameter {
     63      get { return (IValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>)Parameters[ImpactValuesCalculatorParameterName]; }
     64    }
     65    public ILookupParameter<IntRange> FitnessCalculationPartitionParameter {
     66      get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
     67    }
     68    public ILookupParameter<IntValue> PrunedSubtreesParameter {
     69      get { return (ILookupParameter<IntValue>)Parameters[PrunedSubtreesParameterName]; }
     70    }
     71    public ILookupParameter<IntValue> PrunedTreesParameter {
     72      get { return (ILookupParameter<IntValue>)Parameters[PrunedTreesParameterName]; }
     73    }
     74    public IFixedValueParameter<DoubleValue> NodeImpactThresholdParameter {
     75      get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; }
     76    }
     77    public IFixedValueParameter<BoolValue> PruneOnlyZeroImpactNodesParameter {
     78      get { return (IFixedValueParameter<BoolValue>)Parameters[PruneOnlyZeroImpactNodesParameterName]; }
     79    }
     80    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
     81      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
     82    }
     83    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
     84      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
    4585    }
    4686    #endregion
    4787    #region properties
    48     private DoubleValue PrunedSubtrees { get { return NumberOfPrunedSubtreesParameter.ActualValue; } }
    49     private DoubleValue PrunedTrees { get { return NumberOfPrunedTreesParameter.ActualValue; } }
     88    protected IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } }
     89    protected ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactValuesCalculator { get { return ImpactValuesCalculatorParameter.Value; } }
     90    protected IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } }
     91    protected BoolValue PruneOnlyZeroImpactNodes { get { return PruneOnlyZeroImpactNodesParameter.Value; } }
     92    protected DoubleValue NodeImpactThreshold { get { return NodeImpactThresholdParameter.Value; } }
     93    protected ISymbolicExpressionTree SymbolicExpressionTree { get { return SymbolicExpressionTreeParameter.ActualValue; } }
     94    protected DoubleValue Quality { get { return QualityParameter.ActualValue; } }
     95    protected DoubleLimit EstimationLimits { get { return EstimationLimitsParameter.ActualValue; } }
     96    protected ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } }
    5097    #endregion
    5198
    5299    [StorableConstructor]
    53100    protected SymbolicDataAnalysisExpressionPruningOperator(bool deserializing) : base(deserializing) { }
    54     public override IDeepCloneable Clone(Cloner cloner) {
    55       return new SymbolicDataAnalysisExpressionPruningOperator(this, cloner);
     101    protected SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner)
     102      : base(original, cloner) { }
     103
     104    protected SymbolicDataAnalysisExpressionPruningOperator() {
     105      #region add parameters
     106      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
     107      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisModel>(SymbolicDataAnalysisModelParameterName));
     108      Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName));
     109      Parameters.Add(new LookupParameter<IntValue>(PrunedSubtreesParameterName, "A counter of how many subtrees were replaced."));
     110      Parameters.Add(new LookupParameter<IntValue>(PrunedTreesParameterName, "A counter of how many trees were pruned."));
     111      Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, "Specify whether or not only zero impact nodes should be pruned."));
     112      Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, "Specifies an impact value threshold below which nodes should be pruned."));
     113      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
     114      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
     115      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
     116      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName));
     117      #endregion
    56118    }
    57     protected SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner)
    58       : base(original, cloner) {
    59     }
    60 
    61     public SymbolicDataAnalysisExpressionPruningOperator() {
    62       Parameters.Add(new LookupParameter<DoubleValue>(NumberOfPrunedSubtreesParameterName));
    63       Parameters.Add(new LookupParameter<DoubleValue>(NumberOfPrunedTreesParameterName));
    64     }
    65 
    66     public ISymbolicDataAnalysisModel Model { get; set; }
    67     public IDataAnalysisProblemData ProblemData { get; set; }
    68     public ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactsCalculator { get; set; }
    69 
    70     public IntRange FitnessCalculationPartition { get; set; }
    71     public IRandom Random { get; set; }
    72 
    73     public bool PruneOnlyZeroImpactNodes { get; set; }
    74     public double NodeImpactThreshold { get; set; }
    75 
    76119    public override IOperation Apply() {
    77       int prunedSubtrees = 0;
    78 
    79       var nodes = Model.SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
     120      var model = CreateModel();
     121      var nodes = SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
    80122      var rows = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size).ToList();
    81123
    82       for (int j = 0; j < nodes.Count; ++j) {
    83         var node = nodes[j];
     124      var prunedSubtrees = 0;
     125      var prunedTrees = 0;
     126
     127      double quality = Evaluate(model);
     128
     129      for (int i = 0; i < nodes.Count; ++i) {
     130        var node = nodes[i];
    84131        if (node is ConstantTreeNode) continue;
    85132
    86         var impact = ImpactsCalculator.CalculateImpactValue(Model, node, ProblemData, rows);
     133        double impactValue, replacementValue;
     134        ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, ProblemData, rows, out impactValue, out replacementValue, quality);
    87135
    88         if (PruneOnlyZeroImpactNodes) {
    89           if (!impact.IsAlmost(0.0)) continue;
    90         } else {
    91           if (NodeImpactThreshold < impact) continue;
    92         }
     136        if (PruneOnlyZeroImpactNodes.Value && (!impactValue.IsAlmost(0.0))) continue;
     137        else if (NodeImpactThreshold.Value < impactValue) continue;
    93138
    94         var replacementValue = ImpactsCalculator.CalculateReplacementValue(Model, node, ProblemData, rows);
    95139        var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue };
    96140        ReplaceWithConstant(node, constantNode);
    97         j += node.GetLength() - 1; // skip subtrees under the node that was folded
     141        i += node.GetLength() - 1; // skip subtrees under the node that was folded
     142
     143        quality -= impactValue;
    98144
    99145        prunedSubtrees++;
    100146      }
    101147
    102       if (prunedSubtrees > 0) {
    103         lock (PrunedSubtrees) { PrunedSubtrees.Value += prunedSubtrees; }
    104         lock (PrunedTrees) { PrunedTrees.Value += 1; }
    105       }
     148      if (prunedSubtrees > 0) prunedTrees = 1;
     149      PrunedSubtreesParameter.ActualValue = new IntValue(prunedSubtrees);
     150      PrunedTreesParameter.ActualValue = new IntValue(prunedTrees);
     151
    106152      return base.Apply();
    107153    }
     
    112158      parent.InsertSubtree(i, replacement);
    113159    }
     160    protected abstract ISymbolicDataAnalysisModel CreateModel();
     161    protected abstract double Evaluate(IDataAnalysisModel model);
    114162  }
    115163}
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs

    r9708 r10681  
    2222using System.Collections.Generic;
    2323using HeuristicLab.Common;
     24using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2527
    2628namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    27   public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator : ISymbolicDataAnalysisSolutionImpactValuesCalculator {
     29  [StorableClass]
     30  [Item("SymbolicDataAnalysisSolutionImpactValuesCalculator", "Calculates the impact values and replacements values for symbolic expression tree nodes.")]
     31  public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator : Item, ISymbolicDataAnalysisSolutionImpactValuesCalculator {
     32    protected SymbolicDataAnalysisSolutionImpactValuesCalculator() { }
     33
     34    protected SymbolicDataAnalysisSolutionImpactValuesCalculator(SymbolicDataAnalysisSolutionImpactValuesCalculator original, Cloner cloner)
     35      : base(original, cloner) { }
     36    [StorableConstructor]
     37    protected SymbolicDataAnalysisSolutionImpactValuesCalculator(bool deserializing) : base(deserializing) { }
    2838    public abstract double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows);
    2939    public abstract double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN);
     40    public abstract void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN);
    3041
    3142    protected static double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
Note: See TracChangeset for help on using the changeset viewer.