Changeset 12547


Ignore:
Timestamp:
06/30/15 12:32:08 (7 years ago)
Author:
mkommend
Message:

#2175: Merged trunk changes.

Location:
branches/DataAnalysis.ComplexityAnalyzer
Files:
30 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression

  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4

  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r12130 r12547  
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    31   [Item("Symbolic Regression Problem (multi objective)", "Represents a multi objective symbolic regression problem.")]
     31  [Item("Symbolic Regression Problem (multi-objective)", "Represents a multi objective symbolic regression problem.")]
    3232  [StorableClass]
    33   [Creatable("Problems")]
     33  [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 110)]
    3434  public class SymbolicRegressionMultiObjectiveProblem : SymbolicDataAnalysisMultiObjectiveProblem<IRegressionProblemData, ISymbolicRegressionMultiObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem {
    3535    private const double PunishmentFactor = 10;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r12130 r12547  
    202202      int info;
    203203
    204       Dataset ds = problemData.Dataset;
     204      IDataset ds = problemData.Dataset;
    205205      double[,] x = new double[rows.Count(), variableNames.Count];
    206206      int row = 0;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r12130 r12547  
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    30   [Item("Symbolic Regression Problem (single objective)", "Represents a single objective symbolic regression problem.")]
     30  [Item("Symbolic Regression Problem (single-objective)", "Represents a single objective symbolic regression problem.")]
    3131  [StorableClass]
    32   [Creatable("Problems")]
     32  [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 100)]
    3333  public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem {
    3434    private const double PunishmentFactor = 10;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs

    r12130 r12547  
    4747    }
    4848
    49     public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
     49    public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {
    5050      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows)
    5151        .LimitToRange(LowerEstimationLimit, UpperEstimationLimit);
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPhenotypicDiversityAnalyzer.cs

    r12130 r12547  
    3535  [StorableClass]
    3636  public class SymbolicRegressionPhenotypicDiversityAnalyzer : PopulationSimilarityAnalyzer,
    37     ISymbolicDataAnalysisBoundedOperator, ISymbolicDataAnalysisInterpreterOperator, ISymbolicExpressionTreeOperator {
     37    ISymbolicDataAnalysisBoundedOperator, ISymbolicDataAnalysisInterpreterOperator, ISymbolicExpressionTreeAnalyzer {
    3838    #region parameter names
    3939    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningAnalyzer.cs

    r12214 r12547  
    3131  [StorableClass]
    3232  public sealed class SymbolicRegressionPruningAnalyzer : SymbolicDataAnalysisSingleObjectivePruningAnalyzer {
    33     private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";
    3433    private const string PruningOperatorParameterName = "PruningOperator";
    35     private SymbolicRegressionPruningAnalyzer(SymbolicRegressionPruningAnalyzer original, Cloner cloner)
    36       : base(original, cloner) {
     34    public IValueParameter<SymbolicRegressionPruningOperator> PruningOperatorParameter {
     35      get { return (IValueParameter<SymbolicRegressionPruningOperator>)Parameters[PruningOperatorParameterName]; }
    3736    }
    38     public override IDeepCloneable Clone(Cloner cloner) {
    39       return new SymbolicRegressionPruningAnalyzer(this, cloner);
     37
     38    protected override SymbolicDataAnalysisExpressionPruningOperator PruningOperator {
     39      get { return PruningOperatorParameter.Value; }
    4040    }
     41
     42    private SymbolicRegressionPruningAnalyzer(SymbolicRegressionPruningAnalyzer original, Cloner cloner) : base(original, cloner) { }
     43    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionPruningAnalyzer(this, cloner); }
    4144
    4245    [StorableConstructor]
     
    4447
    4548    public SymbolicRegressionPruningAnalyzer() {
    46       Parameters.Add(new ValueParameter<SymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, "The impact values calculator", new SymbolicRegressionSolutionImpactValuesCalculator()));
    47       Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicRegressionPruningOperator(new SymbolicRegressionSolutionImpactValuesCalculator())));
     49      Parameters.Add(new ValueParameter<SymbolicRegressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicRegressionPruningOperator(new SymbolicRegressionSolutionImpactValuesCalculator())));
    4850    }
    4951  }
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs

    r12214 r12547  
    5353    protected override double Evaluate(IDataAnalysisModel model) {
    5454      var regressionModel = (IRegressionModel)model;
    55       var regressionProblemData = (IRegressionProblemData)ProblemData;
    56       var rows = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size);
     55      var regressionProblemData = (IRegressionProblemData)ProblemDataParameter.ActualValue;
     56      var rows = Enumerable.Range(FitnessCalculationPartitionParameter.ActualValue.Start, FitnessCalculationPartitionParameter.ActualValue.Size);
    5757      return Evaluate(regressionModel, regressionProblemData, rows);
    5858    }
     
    7171      var clonedTree = (ISymbolicExpressionTree)tree.Clone();
    7272      var model = new SymbolicRegressionModel(clonedTree, interpreter, estimationLimits.Lower, estimationLimits.Upper);
    73       var nodes = clonedTree.IterateNodesPrefix().ToList();
     73      var nodes = clonedTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList(); // skip the nodes corresponding to the ProgramRootSymbol and the StartSymbol
    7474      double quality = Evaluate(model, problemData, rows);
    7575
     
    8181        impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);
    8282
    83         if (pruneOnlyZeroImpactNodes) {
    84           if (!impactValue.IsAlmost(0.0)) continue;
    85         } else if (nodeImpactThreshold < impactValue) {
    86           continue;
    87         }
     83        if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
     84        if (!pruneOnlyZeroImpactNodes && impactValue > nodeImpactThreshold) continue;
    8885
    8986        var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisModelComplexityAnalyzer.cs

    r12187 r12547  
    5353            for (int i = 0; i < node.SubtreeCount; i++) {
    5454              var nodeComplexity = CalculateComplexity(node.GetSubtree(i));
    55               complexity *= nodeComplexity > 2 ? nodeComplexity : 2;
     55              complexity *= nodeComplexity + 1;
    5656            }
    5757            return complexity;
     
    6161            for (int i = 0; i < node.SubtreeCount; i++) {
    6262              var nodeComplexity = CalculateComplexity(node.GetSubtree(i));
    63               complexity *= nodeComplexity > 2 ? nodeComplexity : 2;
     63              complexity *= nodeComplexity +1;
    6464            }
    6565            return complexity;
     
    7575        case OpCodes.Tan: {
    7676            double complexity = CalculateComplexity(node.GetSubtree(0));
    77             return Math.Pow(2.0, complexity); ;
     77            return Math.Pow(2.0, complexity);
    7878          }
    7979        case OpCodes.Exp: {
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs

    r12130 r12547  
    4545    private const string TotalNumberOfPrunedSubtreesParameterName = "Number of pruned subtrees";
    4646    private const string TotalNumberOfPrunedTreesParameterName = "Number of pruned trees";
     47    private const string TotalNumberOfPrunedNodesParameterName = "Number of pruned nodes";
    4748    private const string RandomParameterName = "Random";
    48     private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes";
    49     private const string NodeImpactThresholdParameterName = "ImpactThreshold";
    50     private const string PruningOperatorParameterName = "PruningOperator";
    5149    private const string ResultsParameterName = "Results";
    5250    private const string PopulationSizeParameterName = "PopulationSize";
     
    5452
    5553    #region private members
     54    private DataReducer prunedNodesReducer;
    5655    private DataReducer prunedSubtreesReducer;
    5756    private DataReducer prunedTreesReducer;
     
    6160
    6261    #region parameter properties
    63     public IValueParameter<SymbolicDataAnalysisExpressionPruningOperator> PruningOperatorParameter {
    64       get { return (IValueParameter<SymbolicDataAnalysisExpressionPruningOperator>)Parameters[PruningOperatorParameterName]; }
    65     }
    66     public IFixedValueParameter<BoolValue> PruneOnlyZeroImpactNodesParameter {
    67       get { return (IFixedValueParameter<BoolValue>)Parameters[PruneOnlyZeroImpactNodesParameterName]; }
    68     }
    69     public IFixedValueParameter<DoubleValue> NodeImpactThresholdParameter {
    70       get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; }
    71     }
    7262    public ILookupParameter<IRandom> RandomParameter {
    7363      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
     
    9181
    9282    #region properties
    93     protected SymbolicDataAnalysisExpressionPruningOperator PruningOperator { get { return PruningOperatorParameter.Value; } }
     83    protected abstract SymbolicDataAnalysisExpressionPruningOperator PruningOperator { get; }
    9484    protected int UpdateInterval { get { return UpdateIntervalParameter.Value.Value; } }
    9585
     
    112102      get { return PruningProbabilityParameter.Value.Value; }
    113103      set { PruningProbabilityParameter.Value.Value = value; }
    114     }
    115 
    116     protected bool PruneOnlyZeroImpactNodes {
    117       get { return PruneOnlyZeroImpactNodesParameter.Value.Value; }
    118       set { PruneOnlyZeroImpactNodesParameter.Value.Value = value; }
    119     }
    120     protected double NodeImpactThreshold {
    121       get { return NodeImpactThresholdParameter.Value.Value; }
    122       set { NodeImpactThresholdParameter.Value.Value = value; }
    123104    }
    124105    #endregion
     
    140121    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner)
    141122      : base(original, cloner) {
     123      if (original.prunedNodesReducer != null)
     124        this.prunedNodesReducer = (DataReducer)original.prunedNodesReducer.Clone();
    142125      if (original.prunedSubtreesReducer != null)
    143126        this.prunedSubtreesReducer = (DataReducer)original.prunedSubtreesReducer.Clone();
     
    197180      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random number generator."));
    198181      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName, "The problem data."));
    199       Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, "The impact threshold  below which an individual should be pruned.", new DoubleValue(0.0)));
    200       Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, "Switch to determine of only zero impact individuals should be pruned.", new BoolValue(false)));
    201182      Parameters.Add(new LookupParameter<IntValue>(PopulationSizeParameterName, "The population of individuals."));
    202183      #endregion
     
    250231      UpdateCounter = 0;
    251232
    252       if (prunedSubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); }
     233      if (prunedNodesReducer == null || prunedSubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); }
    253234
    254235      var prune = CreatePruningOperation();
     236      var reducePrunedNodes = ExecutionContext.CreateChildOperation(prunedNodesReducer);
    255237      var reducePrunedSubtrees = ExecutionContext.CreateChildOperation(prunedSubtreesReducer);
    256238      var reducePrunedTrees = ExecutionContext.CreateChildOperation(prunedTreesReducer);
     
    258240      var collectResults = ExecutionContext.CreateChildOperation(resultsCollector);
    259241
    260       return new OperationCollection { prune, reducePrunedSubtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() };
     242      return new OperationCollection { prune, reducePrunedNodes, reducePrunedSubtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() };
    261243    }
    262244
    263245    private void InitializeOperators() {
     246      prunedNodesReducer = new DataReducer();
     247      prunedNodesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedNodesParameter.ActualName;
     248      prunedNodesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); // sum all the pruned subtrees parameter values
     249      prunedNodesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter
     250      prunedNodesReducer.TargetParameter.ActualName = TotalNumberOfPrunedNodesParameterName;
     251
    264252      prunedSubtreesReducer = new DataReducer();
    265253      prunedSubtreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedSubtreesParameter.ActualName;
     
    275263
    276264      valuesCollector = new DataTableValuesCollector();
     265      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedNodesParameterName));
    277266      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedSubtreesParameterName));
    278267      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedTreesParameterName));
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs

    r12130 r12547  
    3535namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3636  [Item("MultiSymbolicDataAnalysisExpressionCrossover", "Randomly selects and applies one of its crossovers every time it is called.")]
     37  [StorableClass]
    3738  public class MultiSymbolicDataAnalysisExpressionCrossover<T> : StochasticMultiBranch<ISymbolicExpressionTreeCrossover>,
    3839    ISymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
    3940    private const string ParentsParameterName = "Parents";
    40     private const string ChildParameterName = "Child";
     41    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4142    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
    4243    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     
    6263      get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; }
    6364    }
    64     public ILookupParameter<ISymbolicExpressionTree> ChildParameter {
    65       get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[ChildParameterName]; }
     65    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
     66      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    6667    }
    6768    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
     
    99100      Parameters.Add(new ValueLookupParameter<IntRange>(SymbolicDataAnalysisEvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
    100101      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
    101       Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover."));
     102      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The child symbolic expression tree resulting from the crossover."));
    102103
    103104      EvaluatorParameter.Hidden = true;
     
    111112
    112113      SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator";
     114    }
     115
     116    [StorableHook(HookType.AfterDeserialization)]
     117    private void AfterDeserialization() {
     118      // BackwardsCompatibility3.3
     119      #region Backwards compatible code, remove with 3.4
     120      if (!Parameters.ContainsKey(SymbolicExpressionTreeParameterName))
     121        Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
     122      #endregion
    113123    }
    114124
     
    155165    private void ParameterizeCrossovers() {
    156166      foreach (ISymbolicExpressionTreeCrossover op in Operators) {
    157         op.ChildParameter.ActualName = ChildParameter.Name;
     167        op.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
    158168        op.ParentsParameter.ActualName = ParentsParameter.Name;
    159169      }
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionContextAwareCrossover.cs

    r12130 r12547  
    2727using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Random;
    2930
    3031namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    6869          possibleChildren.Add(n);
    6970      });
    70       var selectedChild = possibleChildren.SelectRandom(random);
     71
     72      var selectedChild = possibleChildren.SampleRandom(random);
    7173      var crossoverPoints = new List<CutPoint>();
    7274      var qualities = new List<Tuple<CutPoint, double>>();
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs

    r12130 r12547  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HeuristicLab.Random;
    3132
    3233namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    115116        throw new Exception("No crossover points available in the first parent");
    116117
    117       var crossoverPoint0 = crossoverPoints0.SelectRandom(random);
    118 
     118      var crossoverPoint0 = crossoverPoints0.SampleRandom(random);
    119119      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
    120120      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
     
    126126                             select s).ToList();
    127127      if (allowedBranches.Count == 0) return parent0;
    128       var selectedBranch = allowedBranches.SelectRandom(random);
     128
     129      var selectedBranch = allowedBranches.SampleRandom(random);
    129130      Swap(crossoverPoint0, selectedBranch);
    130131      return parent0;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs

    r12130 r12547  
    2727using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Random;
    2930
    3031namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    6768          crossoverPoints0.Add(new CutPoint(n.Parent, n));
    6869      });
    69       CutPoint crossoverPoint0 = crossoverPoints0.SelectRandom(random);
     70
     71      CutPoint crossoverPoint0 = crossoverPoints0.SampleRandom(random);
    7072      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
    7173      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs

    r12130 r12547  
    2727using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Random;
    2930
    3031namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    6970        }
    7071      });
    71       var crossoverPoint0 = crossoverPoints0.SelectRandom(random);
     72
     73      var crossoverPoint0 = crossoverPoints0.SampleRandom(random);
    7274      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
    7375      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
     
    137139          weights[i] /= sum;
    138140
     141#pragma warning disable 612, 618
    139142        selectedBranch = allowedBranches.SelectRandom(weights, random);
     143#pragma warning restore 612, 618
    140144      }
    141145      Swap(crossoverPoint0, selectedBranch);
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs

    r12130 r12547  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Random;
    3031
    3132namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    8182          crossoverPoints0.Add(new CutPoint(n.Parent, n));
    8283      });
    83       var crossoverPoint0 = crossoverPoints0.SelectRandom(random);
     84
     85      var crossoverPoint0 = crossoverPoints0.SampleRandom(random);
    8486      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
    8587      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs

    r12130 r12547  
    7171    }
    7272
    73     public string Format(ISymbolicExpressionTree symbolicExpressionTree, Dataset dataset) {
     73    public string Format(ISymbolicExpressionTree symbolicExpressionTree, IDataset dataset) {
    7474      var stringBuilder = new StringBuilder();
    7575      if (dataset != null) CalculateVariableMapping(symbolicExpressionTree, dataset);
     
    8585    }
    8686
    87     private void CalculateVariableMapping(ISymbolicExpressionTree tree, Dataset dataset) {
     87    private void CalculateVariableMapping(ISymbolicExpressionTree tree, IDataset dataset) {
    8888      int columnIndex = 0;
    8989      int inputIndex = 0;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r12130 r12547  
    198198      <SubType>Code</SubType>
    199199    </Compile>
     200    <Compile Include="Formatters\SymbolicDataAnalysisExpressionCSharpFormatter.cs" />
    200201    <Compile Include="Importer\SymbolicExpressionImporter.cs" />
    201202    <Compile Include="Importer\Token.cs" />
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionTreeInterpreter.cs

    r12130 r12547  
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2828  public interface ISymbolicDataAnalysisExpressionTreeInterpreter : INamedItem, IStatefulItem {
    29     IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows);
     29    IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows);
    3030    IntValue EvaluatedSolutions { get; set; }
    3131  }
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r12130 r12547  
    138138    #endregion
    139139
    140     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     140    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
    141141      if (CheckExpressionsWithIntervalArithmetic.Value)
    142142        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
     
    161161    }
    162162
    163     private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {
     163    private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) {
    164164      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
    165165      Dictionary<string, int> doubleVariableNames = dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i);
     
    182182    }
    183183
    184     private void CompileInstructions(ILGenerator il, InterpreterState state, Dataset ds) {
     184    private void CompileInstructions(ILGenerator il, InterpreterState state, IDataset ds) {
    185185      Instruction currentInstr = state.NextInstruction();
    186186      int nArgs = currentInstr.nArguments;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r12130 r12547  
    9595    #endregion
    9696
    97     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     97    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
    9898      if (CheckExpressionsWithIntervalArithmetic.Value)
    9999        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
     
    111111    }
    112112
    113     private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, Dataset dataset) {
     113    private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) {
    114114      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
    115115      int necessaryArgStackSize = 0;
     
    132132
    133133
    134     public virtual double Evaluate(Dataset dataset, ref int row, InterpreterState state) {
     134    public virtual double Evaluate(IDataset dataset, ref int row, InterpreterState state) {
    135135      Instruction currentInstr = state.NextInstruction();
    136136      switch (currentInstr.opCode) {
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

    r12130 r12547  
    102102    #endregion
    103103
    104     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     104    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
    105105      if (CheckExpressionsWithIntervalArithmetic.Value)
    106106        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
     
    115115    }
    116116
    117     private double Evaluate(Dataset dataset, int row, LinearInstruction[] code) {
     117    private double Evaluate(IDataset dataset, int row, LinearInstruction[] code) {
    118118      for (int i = code.Length - 1; i >= 0; --i) {
    119119        if (code[i].skip) continue;
     
    352352    }
    353353
    354     public static void PrepareInstructions(LinearInstruction[] code, Dataset dataset) {
     354    public static void PrepareInstructions(LinearInstruction[] code, IDataset dataset) {
    355355      for (int i = 0; i != code.Length; ++i) {
    356356        var instr = code[i];
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs

    r12214 r12547  
    3434  [StorableClass]
    3535  [Item("SymbolicExpressionTreePruningOperator", "An operator that replaces introns with constant values in a symbolic expression tree.")]
    36   public abstract class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator {
     36  public abstract class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator, ISymbolicExpressionTreeOperator {
    3737    #region parameter names
    3838    private const string ProblemDataParameterName = "ProblemData";
     
    4141    private const string PrunedSubtreesParameterName = "PrunedSubtrees";
    4242    private const string PrunedTreesParameterName = "PrunedTrees";
     43    private const string PrunedNodesParameterName = "PrunedNodes";
    4344    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
    4445    private const string NodeImpactThresholdParameterName = "ImpactThreshold";
     
    7273      get { return (ILookupParameter<IntValue>)Parameters[PrunedTreesParameterName]; }
    7374    }
     75    public ILookupParameter<IntValue> PrunedNodesParameter {
     76      get { return (ILookupParameter<IntValue>)Parameters[PrunedNodesParameterName]; }
     77    }
    7478    public IFixedValueParameter<DoubleValue> NodeImpactThresholdParameter {
    7579      get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; }
     
    8791
    8892    #region properties
    89     protected IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } }
    90     protected ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactValuesCalculator { get { return ImpactValuesCalculatorParameter.Value; } }
    91     protected IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } }
    92     protected bool PruneOnlyZeroImpactNodes {
     93    public ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactValuesCalculator {
     94      get { return ImpactValuesCalculatorParameter.Value; }
     95      set { ImpactValuesCalculatorParameter.Value = value; }
     96    }
     97    public bool PruneOnlyZeroImpactNodes {
    9398      get { return PruneOnlyZeroImpactNodesParameter.Value.Value; }
    9499      set { PruneOnlyZeroImpactNodesParameter.Value.Value = value; }
    95100    }
    96     protected double NodeImpactThreshold {
     101    public double NodeImpactThreshold {
    97102      get { return NodeImpactThresholdParameter.Value.Value; }
    98103      set { NodeImpactThresholdParameter.Value.Value = value; }
    99104    }
    100     protected ISymbolicExpressionTree SymbolicExpressionTree { get { return SymbolicExpressionTreeParameter.ActualValue; } }
    101     protected DoubleValue Quality { get { return QualityParameter.ActualValue; } }
    102     protected DoubleLimit EstimationLimits { get { return EstimationLimitsParameter.ActualValue; } }
    103     protected ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } }
    104105    #endregion
    105106
     
    114115      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisModel>(SymbolicDataAnalysisModelParameterName));
    115116      Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName));
     117      Parameters.Add(new LookupParameter<IntValue>(PrunedNodesParameterName, "A counter of how many nodes were pruned."));
    116118      Parameters.Add(new LookupParameter<IntValue>(PrunedSubtreesParameterName, "A counter of how many subtrees were replaced."));
    117119      Parameters.Add(new LookupParameter<IntValue>(PrunedTreesParameterName, "A counter of how many trees were pruned."));
     
    131133
    132134    public override IOperation Apply() {
    133       var model = CreateModel(SymbolicExpressionTree, Interpreter, ProblemData, EstimationLimits);
    134       var nodes = SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
    135       var rows = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size);
     135      var tree = SymbolicExpressionTreeParameter.ActualValue;
     136      var problemData = ProblemDataParameter.ActualValue;
     137      var fitnessCalculationPartition = FitnessCalculationPartitionParameter.ActualValue;
     138      var estimationLimits = EstimationLimitsParameter.ActualValue;
     139      var interpreter = InterpreterParameter.ActualValue;
     140
     141      var model = CreateModel(tree, interpreter, problemData, estimationLimits);
     142      var nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
     143      var rows = Enumerable.Range(fitnessCalculationPartition.Start, fitnessCalculationPartition.Size);
    136144      var prunedSubtrees = 0;
    137145      var prunedTrees = 0;
     146      var prunedNodes = 0;
    138147
    139148      double quality = Evaluate(model);
     
    144153
    145154        double impactValue, replacementValue;
    146         ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, ProblemData, rows, out impactValue, out replacementValue, quality);
     155        ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);
    147156
    148         if (PruneOnlyZeroImpactNodes) {
    149           if (!impactValue.IsAlmost(0.0)) continue;
    150         } else if (NodeImpactThreshold < impactValue) {
    151           continue;
    152         }
     157        if (PruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
     158        if (!PruneOnlyZeroImpactNodes && impactValue > NodeImpactThreshold) continue;
    153159
    154160        var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
    155161        constantNode.Value = replacementValue;
    156162
     163        var length = node.GetLength();
    157164        ReplaceWithConstant(node, constantNode);
    158         i += node.GetLength() - 1; // skip subtrees under the node that was folded
     165        i += length - 1; // skip subtrees under the node that was folded
    159166
    160167        quality -= impactValue;
    161 
    162168        prunedSubtrees++;
     169        prunedNodes += length;
    163170      }
    164171
     
    166173      PrunedSubtreesParameter.ActualValue = new IntValue(prunedSubtrees);
    167174      PrunedTreesParameter.ActualValue = new IntValue(prunedTrees);
     175      PrunedNodesParameter.ActualValue = new IntValue(prunedNodes);
     176      QualityParameter.ActualValue.Value = quality;
    168177
    169178      return base.Apply();
    170     }
    171 
    172     public ISymbolicExpressionTree Prune(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, DoubleLimit estimationLimits) {
    173       var model = CreateModel((ISymbolicExpressionTree)tree.Clone(), Interpreter, ProblemData, EstimationLimits);
    174       var nodes = SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
    175       var rows = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size);
    176 
    177       double quality = Evaluate(model);
    178 
    179       for (int i = 0; i < nodes.Count; ++i) {
    180         var node = nodes[i];
    181         if (node is ConstantTreeNode) continue;
    182 
    183         double impactValue, replacementValue;
    184         ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, ProblemData, rows, out impactValue, out replacementValue, quality);
    185 
    186         if (PruneOnlyZeroImpactNodes) {
    187           if (!impactValue.IsAlmost(0.0)) continue;
    188         } else if (NodeImpactThreshold < impactValue) {
    189           continue;
    190         }
    191 
    192         var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
    193         constantNode.Value = replacementValue;
    194 
    195         ReplaceWithConstant(node, constantNode);
    196         i += node.GetLength() - 1; // skip subtrees under the node that was folded
    197 
    198         quality -= impactValue;
    199       }
    200       return model.SymbolicExpressionTree;
    201179    }
    202180
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs

    r12233 r12547  
    287287        // make sum(x0..xn) / n
    288288        var sum = original.Subtrees
    289           .Select(x => GetSimplifiedTree(x))
    290           .Aggregate((a, b) => MakeSum(a, b));
     289          .Select(GetSimplifiedTree)
     290          .Aggregate(MakeSum);
    291291        return MakeFraction(sum, MakeConstant(original.Subtrees.Count()));
    292292      }
     
    299299        // simplify expressions x0..xn
    300300        // make multiplication (x0 * 1/(x1 * x1 * .. * xn))
    301         var simplifiedTrees = original.Subtrees.Select(GetSimplifiedTree).ToArray();
     301        var first = original.GetSubtree(0);
     302        var second = original.GetSubtree(1);
     303        var remaining = original.Subtrees.Skip(2);
    302304        return
    303           MakeProduct(simplifiedTrees.First(), Invert(simplifiedTrees.Skip(1).Aggregate(MakeProduct)));
     305          MakeProduct(GetSimplifiedTree(first), Invert(remaining.Aggregate(GetSimplifiedTree(second), (a, b) => MakeProduct(a, GetSimplifiedTree(b)))));
    304306      }
    305307    }
     
    310312      } else {
    311313        return original.Subtrees
    312           .Select(GetSimplifiedTree).ToArray()
     314          .Select(GetSimplifiedTree)
    313315          .Aggregate(MakeProduct);
    314316      }
     
    321323        // simplify expressions x0..xn
    322324        // make addition (x0,-x1..-xn)
    323         var simplifiedTrees = original.Subtrees.Select(GetSimplifiedTree).ToArray();
    324         return simplifiedTrees.Take(1)
    325           .Concat(simplifiedTrees.Skip(1).Select(Negate))
    326           .Aggregate(MakeSum);
     325        var first = original.Subtrees.First();
     326        var remaining = original.Subtrees.Skip(1);
     327        return remaining.Aggregate(GetSimplifiedTree(first), (a, b) => MakeSum(a, Negate(GetSimplifiedTree(b))));
    327328      }
    328329    }
     
    335336        // make addition (x0..xn)
    336337        return original.Subtrees
    337           .Select(GetSimplifiedTree).ToArray()
     338          .Select(GetSimplifiedTree)
    338339          .Aggregate(MakeSum);
    339340      }
     
    345346    private ISymbolicExpressionTreeNode SimplifyOr(ISymbolicExpressionTreeNode original) {
    346347      return original.Subtrees
    347         .Select(x => GetSimplifiedTree(x))
    348         .Aggregate((a, b) => MakeOr(a, b));
     348        .Select(GetSimplifiedTree)
     349        .Aggregate(MakeOr);
    349350    }
    350351    private ISymbolicExpressionTreeNode SimplifyAnd(ISymbolicExpressionTreeNode original) {
    351352      return original.Subtrees
    352         .Select(x => GetSimplifiedTree(x))
    353         .Aggregate((a, b) => MakeAnd(a, b));
     353        .Select(GetSimplifiedTree)
     354        .Aggregate(MakeAnd);
    354355    }
    355356    private ISymbolicExpressionTreeNode SimplifyLessThan(ISymbolicExpressionTreeNode original) {
     
    831832    private void MergeVariablesInSum(ISymbolicExpressionTreeNode sum) {
    832833      var subtrees = new List<ISymbolicExpressionTreeNode>(sum.Subtrees);
    833       while (sum.Subtrees.Count() > 0) sum.RemoveSubtree(0);
     834      while (sum.Subtrees.Any()) sum.RemoveSubtree(0);
    834835      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
    835836                            let lag = (node is LaggedVariableTreeNode) ? ((LaggedVariableTreeNode)node).Lag : 0
     
    949950    private void MergeVariablesAndConstantsInProduct(ISymbolicExpressionTreeNode prod) {
    950951      var subtrees = new List<ISymbolicExpressionTreeNode>(prod.Subtrees);
    951       while (prod.Subtrees.Count() > 0) prod.RemoveSubtree(0);
     952      while (prod.Subtrees.Any()) prod.RemoveSubtree(0);
    952953      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
    953954                            let lag = (node is LaggedVariableTreeNode) ? ((LaggedVariableTreeNode)node).Lag : 0
     
    10041005      } else if (IsAddition(x)) {
    10051006        // (x0 + x1 + .. + xn) * -1 => (-x0 + -x1 + .. + -xn)       
    1006         List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(x.Subtrees);
    1007         while (x.Subtrees.Count() > 0) x.RemoveSubtree(0);
     1007        var subtrees = new List<ISymbolicExpressionTreeNode>(x.Subtrees);
     1008        while (x.Subtrees.Any()) x.RemoveSubtree(0);
    10081009        foreach (var subtree in subtrees) {
    10091010          x.AddSubtree(Negate(subtree));
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r12130 r12547  
    321321      foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) {
    322322        op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    323         op.ChildParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     323        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    324324      }
    325325      foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) {
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs

    r12130 r12547  
    4141
    4242    protected static double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
    43       Dataset dataset, IEnumerable<int> rows) {
     43      IDataset dataset, IEnumerable<int> rows) {
    4444      //optimization: constant nodes return always the same value
    4545      ConstantTreeNode constantNode = node as ConstantTreeNode;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs

    r12130 r12547  
    7474      base.ResetLocalParameters(random);
    7575      threshold = NormalDistributedRandom.NextDouble(random, Symbol.ThresholdInitializerMu, Symbol.ThresholdInitializerSigma);
     76
     77#pragma warning disable 612, 618
    7678      variableName = Symbol.VariableNames.SelectRandom(random);
     79#pragma warning restore 612, 618
     80
    7781      slope = NormalDistributedRandom.NextDouble(random, Symbol.SlopeInitializerMu, Symbol.SlopeInitializerSigma);
    7882    }
     
    8286      double x = NormalDistributedRandom.NextDouble(random, Symbol.ThresholdManipulatorMu, Symbol.ThresholdManipulatorSigma);
    8387      threshold = threshold + x * shakingFactor;
     88
     89#pragma warning disable 612, 618
    8490      variableName = Symbol.VariableNames.SelectRandom(random);
     91#pragma warning restore 612, 618
     92
    8593      x = NormalDistributedRandom.NextDouble(random, Symbol.SlopeManipulatorMu, Symbol.SlopeManipulatorSigma);
    8694      slope = slope + x * shakingFactor;
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNode.cs

    r12130 r12547  
    6161      base.ResetLocalParameters(random);
    6262      weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma);
     63
     64#pragma warning disable 612, 618
    6365      variableName = Symbol.VariableNames.SelectRandom(random);
     66#pragma warning restore 612, 618
    6467    }
    6568
     
    7073        double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma);
    7174        weight = weight + x * shakingFactor;
    72       } else {       
     75      } else {
    7376        double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma);
    7477        weight = weight * x;
    7578      }
     79#pragma warning disable 612, 618
    7680      variableName = Symbol.VariableNames.SelectRandom(random);
     81#pragma warning restore 612, 618
    7782    }
    7883
Note: See TracChangeset for help on using the changeset viewer.