Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/11/20 13:36:02 (5 years ago)
Author:
bburlacu
Message:

#1772: Merge trunk changes and fix all errors and compilation warnings.

Location:
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers

    • Property svn:ignore
      •  

        old new  
        1 BuidingBlocks
         1SymbolicDataAnalysisBuildingBlockAnalyzer.cs
         2SymbolicDataAnalysisHashBasedDiversityAnalyzer.cs
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers/SymbolicDataAnalysisPoly10Analyzer.cs

    r12891 r17434  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
     22using HEAL.Attic;
    2523using HeuristicLab.Common;
    2624using HeuristicLab.Core;
     
    2927using HeuristicLab.Optimization;
    3028using HeuristicLab.Parameters;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using System;
     30using System.Collections.Generic;
     31using System.Linq;
    3232using DataRow = HeuristicLab.Analysis.DataRow;
    3333using DataTable = HeuristicLab.Analysis.DataTable;
    3434
    35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers.BuidingBlocks {
     35namespace HeuristicLab.Problems.DataAnalysis.Symbolic
     36{
    3637  [Item("Poly-10 building blocks analyzer", "An analyzer which attempts to identify parts of the Poly-10 formula")]
    37   [StorableClass]
    38   public class SymbolicDataAnalysisPoly10Analyzer : SymbolicDataAnalysisAnalyzer {
     38  [StorableType("FA93D06D-B7CE-428A-8B22-ACB9A2BCE3CB")]
     39  public class SymbolicDataAnalysisPoly10Analyzer : SymbolicDataAnalysisAnalyzer
     40  {
    3941    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
    4042    private const string ProblemDataParameterName = "ProblemData";
     
    9496    #endregion
    9597
    96     public SymbolicDataAnalysisPoly10Analyzer() {
     98    public SymbolicDataAnalysisPoly10Analyzer()
     99    {
    97100      #region Add parameters
    98101      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
     
    106109
    107110    [StorableConstructor]
    108     protected SymbolicDataAnalysisPoly10Analyzer(bool deserializing)
    109       : base(deserializing) {
    110     }
     111    protected SymbolicDataAnalysisPoly10Analyzer(StorableConstructorFlag _) : base(_) { }
    111112
    112113    protected SymbolicDataAnalysisPoly10Analyzer(SymbolicDataAnalysisPoly10Analyzer original, Cloner cloner)
    113       : base(original, cloner) {
    114     }
    115 
    116     public override IDeepCloneable Clone(Cloner cloner) {
     114      : base(original, cloner)
     115    {
     116    }
     117
     118    public override IDeepCloneable Clone(Cloner cloner)
     119    {
    117120      return new SymbolicDataAnalysisPoly10Analyzer(this, cloner);
    118121    }
     
    122125    }
    123126
    124     public override IOperation Apply() {
     127    public override IOperation Apply()
     128    {
    125129      #region Update counter & update interval
    126130      UpdateCounter++;
    127       if (UpdateCounter != UpdateInterval) {
     131      if (UpdateCounter != UpdateInterval)
     132      {
    128133        return base.Apply();
    129134      }
     
    142147      var bbFrequencies = evaluationMap.Keys.ToDictionary(x => x, x => 0);
    143148
    144       foreach (var key in evaluationMap.Keys) {
     149      foreach (var key in evaluationMap.Keys)
     150      {
    145151        var bb = fragmentMap[key];
    146152        int len = bb.GetLength();
    147         foreach (var t in trees) {
     153        foreach (var t in trees)
     154        {
    148155          var root = t.Root.GetSubtree(0).GetSubtree(0);
    149156          var nodes = root.IterateNodesPrefix().Where(x => x.GetLength() > len).ToList();
    150157
    151           for (int i = 0; i < nodes.Count; ++i) {
     158          for (int i = 0; i < nodes.Count; ++i)
     159          {
    152160            var s = nodes[i];
    153161            var values = interpreter.GetValues(s, dataset, rows);
     
    155163            var r = OnlinePearsonsRCalculator.Calculate(values, evaluationMap[key], out error);
    156164            var r2 = error == OnlineCalculatorError.None ? r * r : double.NaN;
    157             if (!double.IsNaN(r2) && r2 >= PhenotypicSimilarityThreshold) {
     165            if (!double.IsNaN(r2) && r2 >= PhenotypicSimilarityThreshold)
     166            {
    158167              bbFrequencies[key]++;
    159168              i += s.GetLength();
     
    163172      }
    164173      var table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value;
    165       foreach (var pair in bbFrequencies) {
     174      foreach (var pair in bbFrequencies)
     175      {
    166176        var formatter = new SymbolicExpressionTreeStringFormatter();
    167177        //        var label = formatter.Format(fragmentMap[pair.Key]) + "(" + prettyLabels[pair.Key] + ")";
    168178        var label = prettyLabels[pair.Key];
    169         if (table.Rows.ContainsKey(label)) {
     179        if (table.Rows.ContainsKey(label))
     180        {
    170181          var row = table.Rows[label];
    171182          row.Values.Add(pair.Value);
     
    176187    }
    177188
    178     private void InitializeBuildingBlockCollection() {
     189    private void InitializeBuildingBlockCollection()
     190    {
    179191      #region Add building blocks
    180192      // building blocks
     
    215227      var rows = ProblemDataParameter.ActualValue.TrainingIndices.ToList();
    216228
    217       foreach (var s in new[] { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10 }) {
     229      foreach (var s in new[] { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10 })
     230      {
    218231        if (evaluationMap.ContainsKey(s)) continue;
    219232        var t = importer.Import(s);
     
    224237      var results = ResultCollectionParameter.ActualValue;
    225238      DataTable table;
    226       if (!results.ContainsKey(BuildingBlocksFrequenciesTableName)) {
     239      if (!results.ContainsKey(BuildingBlocksFrequenciesTableName))
     240      {
    227241        table = new DataTable(BuildingBlocksFrequenciesTableName);
    228242        results.Add(new Result(BuildingBlocksFrequenciesTableName, table));
    229       } else {
     243      }
     244      else
     245      {
    230246        table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value;
    231247      }
    232248      table.Rows.Clear();
    233       foreach (var key in evaluationMap.Keys) {
     249      foreach (var key in evaluationMap.Keys)
     250      {
    234251        table.Rows.Add(new DataRow(prettyLabels[key]) { VisualProperties = { StartIndexZero = true } });
    235252      }
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    3030using HeuristicLab.Parameters;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HEAL.Attic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3434  [Item("SymbolicDataAnalysisAlleleFrequencyAnalyzer", "")]
    35   [StorableClass]
     35  [StorableType("36383269-BEEF-4B2C-A95E-5A3DCE6B2DB8")]
    3636  public sealed class SymbolicDataAnalysisAlleleFrequencyAnalyzer : AlleleFrequencyAnalyzer<ISymbolicExpressionTree>, ISymbolicDataAnalysisAnalyzer {
    3737    private const string AlleleTreeDepthParameterName = "AlleleTreeDepth";
     
    5858
    5959    [StorableConstructor]
    60     private SymbolicDataAnalysisAlleleFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
     60    private SymbolicDataAnalysisAlleleFrequencyAnalyzer(StorableConstructorFlag _) : base(_) { }
    6161    private SymbolicDataAnalysisAlleleFrequencyAnalyzer(SymbolicDataAnalysisAlleleFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { }
    6262    public SymbolicDataAnalysisAlleleFrequencyAnalyzer()
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2626using HeuristicLab.Optimization;
    2727using HeuristicLab.Parameters;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HEAL.Attic;
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3232  /// Abstract base class for symbolic data analysis analyzers.
    3333  /// </summary>
    34   [StorableClass]
     34  [StorableType("A88BA918-D933-449E-9816-8C2A509CC0C4")]
    3535  public abstract class SymbolicDataAnalysisAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer {
    3636    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
     
    5757    #endregion
    5858    [StorableConstructor]
    59     protected SymbolicDataAnalysisAnalyzer(bool deserializing) : base(deserializing) { }
     59    protected SymbolicDataAnalysisAnalyzer(StorableConstructorFlag _) : base(_) { }
    6060    protected SymbolicDataAnalysisAnalyzer(SymbolicDataAnalysisAnalyzer original, Cloner cloner)
    6161      : base(original, cloner) {
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HEAL.Attic;
    2526using HeuristicLab.Data;
    2627using HeuristicLab.Parameters;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3030  [Item("SymbolicDataAnalysisBottomUpDiversityAnalyzer", "A diversity analyzer based on the bottom-up distance between trees.")]
    31   [StorableClass]
     31  [StorableType("822FB7E4-3CFF-4413-90EB-96E90CE1D1D4")]
    3232  public class SymbolicDataAnalysisBottomUpDiversityAnalyzer : PopulationSimilarityAnalyzer {
    3333    private const string MatchConstantValuesParameterName = "MatchConstantValues";
     
    5858
    5959    [StorableConstructor]
    60     protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(bool deserializing) : base(deserializing) { }
     60    protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(StorableConstructorFlag _) : base(_) { }
    6161
    6262    protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(SymbolicDataAnalysisBottomUpDiversityAnalyzer original, Cloner cloner)
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGenealogyAnalyzer.cs

    r12892 r17434  
    2121
    2222using System.Linq;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    2829using HeuristicLab.Optimization;
    2930using HeuristicLab.Parameters;
    30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3131
    3232namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3333  [Item("SymbolicDataAnalysisGenealogyAnalyzer", "Genealogy analyzer for symbolic data analysis problems")]
    34   [StorableClass]
     34  [StorableType("A3D2A9C6-D304-47F1-9F02-6ABA9A0F4428")]
    3535  public class SymbolicDataAnalysisGenealogyAnalyzer : GenealogyAnalyzer<ISymbolicExpressionTree> {
    3636    private const string EvaluatorParameterName = "Evaluator";
     
    8585
    8686    [StorableConstructor]
    87     protected SymbolicDataAnalysisGenealogyAnalyzer(bool deserializing) : base(deserializing) {
     87    protected SymbolicDataAnalysisGenealogyAnalyzer(StorableConstructorFlag _) : base(_) {
    8888    }
    8989
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs

    r14574 r17434  
    2222using System.Collections.Generic;
    2323using System.Linq;
     24using HEAL.Attic;
    2425using HeuristicLab.Analysis;
    2526using HeuristicLab.Common;
     
    3031using HeuristicLab.Optimization;
    3132using HeuristicLab.Parameters;
    32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3333
    3434namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers {
    35   [StorableClass]
    3635  [Item("SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer", "An analyzer which records the best and average genetic operator improvement")]
     36  [StorableType("A139170C-FB98-49B0-884C-5BD20F296AC1")]
    3737  public class SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
    3838    public const string QualityParameterName = "Quality";
     
    6767
    6868    [StorableConstructor]
    69     protected SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(bool deserializing) : base(deserializing) { }
     69    protected SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(StorableConstructorFlag _) : base(_) { }
    7070
    7171    public SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Parameters;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3030  /// Abstract base class for multi objective symbolic data analysis analyzers.
    3131  /// </summary>
    32   [StorableClass]
     32  [StorableType("C9896773-7A11-4D68-86EC-DB04AE075637")]
    3333  public abstract class SymbolicDataAnalysisMultiObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisMultiObjectiveAnalyzer {
    3434    private const string QualitiesParameterName = "Qualities";
     
    5555    #endregion
    5656    [StorableConstructor]
    57     protected SymbolicDataAnalysisMultiObjectiveAnalyzer(bool deserializing) : base(deserializing) { }
     57    protected SymbolicDataAnalysisMultiObjectiveAnalyzer(StorableConstructorFlag _) : base(_) { }
    5858    protected SymbolicDataAnalysisMultiObjectiveAnalyzer(SymbolicDataAnalysisMultiObjectiveAnalyzer original, Cloner cloner)
    5959      : base(original, cloner) {
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2828using HeuristicLab.Optimization;
    2929using HeuristicLab.Parameters;
    30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HEAL.Attic;
    3131
    3232namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3535  /// </summary>
    3636  [Item("SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for multi objective symbolic data analysis problems.")]
    37   [StorableClass]
     37  [StorableType("D43D38D1-EEA8-4DEF-AA95-6E941194D708")]
    3838  public abstract class SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisMultiObjectiveAnalyzer
    3939    where T : class, ISymbolicDataAnalysisSolution {
     
    7070
    7171    [StorableConstructor]
    72     protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     72    protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
    7373    protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
    7474    public SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer()
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Parameters;
    29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HEAL.Attic;
    3030using HeuristicLab.Random;
    3131
     
    3434  /// Abstract base class for symbolic data analysis analyzers that validate a solution on a separate data partition using the evaluator.
    3535  /// </summary>
    36   [StorableClass]
     36  [StorableType("506B8D0E-891C-453B-842C-18CB33F5CE32")]
    3737  public abstract class SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisMultiObjectiveAnalyzer,
    3838    ISymbolicDataAnalysisValidationAnalyzer<T, U>
     
    6868
    6969    [StorableConstructor]
    70     protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(bool deserializing) : base(deserializing) { }
     70    protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(StorableConstructorFlag _) : base(_) { }
    7171    protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U> original, Cloner cloner)
    7272      : base(original, cloner) {
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HEAL.Attic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3636  /// </summary>
    3737  [Item("SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for multi objective symbolic data analysis problems.")]
    38   [StorableClass]
     38  [StorableType("ABDCE5CB-E177-4382-B478-90372FE6D47F")]
    3939  public abstract class SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U>,
    4040    ISymbolicDataAnalysisMultiObjectiveAnalyzer
     
    7272
    7373    [StorableConstructor]
    74     protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     74    protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
    7575    protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
    7676    public SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer()
     
    177177    }
    178178
     179    [StorableType("69cfeefe-8654-4d07-93f1-fdca6fe02338")]
    179180    private class DoubleArrayComparer : IEqualityComparer<double[]> {
    180181      public bool Equals(double[] x, double[] y) {
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Parameters;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3030  /// Abstract base class for single objective symbolic data analysis analyzers.
    3131  /// </summary>
    32   [StorableClass]
     32  [StorableType("D5972132-2908-4878-97C5-C423164FCF65")]
    3333  public abstract class SymbolicDataAnalysisSingleObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisSingleObjectiveAnalyzer {
    3434    private const string QualityParameterName = "Quality";
     
    5656    #endregion
    5757    [StorableConstructor]
    58     protected SymbolicDataAnalysisSingleObjectiveAnalyzer(bool deserializing) : base(deserializing) { }
     58    protected SymbolicDataAnalysisSingleObjectiveAnalyzer(StorableConstructorFlag _) : base(_) { }
    5959    protected SymbolicDataAnalysisSingleObjectiveAnalyzer(SymbolicDataAnalysisSingleObjectiveAnalyzer original, Cloner cloner)
    6060      : base(original, cloner) {
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs

    r16130 r17434  
    22
    33/* HeuristicLab
    4  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    55 *
    66 * This file is part of HeuristicLab.
     
    3131using HeuristicLab.Optimization.Operators;
    3232using HeuristicLab.Parameters;
    33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     33using HEAL.Attic;
    3434
    3535namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    36   [StorableClass]
     36  [StorableType("83603E95-3CBD-476C-B11F-B30C80ACD0D3")]
    3737  [Item("SymbolicDataAnalysisSingleObjectivePruningAnalyzer", "An analyzer that prunes introns from trees in single objective symbolic data analysis problems.")]
    3838  public abstract class SymbolicDataAnalysisSingleObjectivePruningAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer {
     
    117117
    118118    [StorableConstructor]
    119     protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(bool deserializing) : base(deserializing) { }
     119    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(StorableConstructorFlag _) : base(_) { }
    120120
    121121    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner)
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2727using HeuristicLab.Optimization;
    2828using HeuristicLab.Parameters;
    29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HEAL.Attic;
    3030
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3434  /// </summary>
    3535  [Item("SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    36   [StorableClass]
     36  [StorableType("DD82C026-CF68-40D7-A898-77EA6A872DE9")]
    3737  public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, IIterationBasedOperator where T : class, ISymbolicDataAnalysisSolution {
    3838    private const string TrainingBestSolutionParameterName = "Best training solution";
     
    9494
    9595    [StorableConstructor]
    96     protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     96    protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
    9797    protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
    9898    public SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer()
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HEAL.Attic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3636  /// </summary>
    3737  [Item("SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    38   [StorableClass]
     38  [StorableType("0C0557F2-DCBC-4699-9BA9-3E82C858605E")]
    3939  public abstract class SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
    4040    where T : class, ISymbolicDataAnalysisSolution
     
    8383
    8484    [StorableConstructor]
    85     protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     85    protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
    8686    protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> original, Cloner cloner) : base(original, cloner) { }
    8787    public SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer()
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2828using HeuristicLab.Optimization;
    2929using HeuristicLab.Parameters;
    30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HEAL.Attic;
    3131using HeuristicLab.Random;
    3232
     
    3535  /// Abstract base class for symbolic data analysis analyzers that validate a solution on a separate data partition using the evaluator.
    3636  /// </summary>
    37   [StorableClass]
     37  [StorableType("B1A1F3CC-5C21-42F4-BED0-831E0D4AD1F6")]
    3838  public abstract class SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisSingleObjectiveAnalyzer,
    3939    ISymbolicDataAnalysisValidationAnalyzer<T, U>, IStochasticOperator
     
    7373
    7474    [StorableConstructor]
    75     protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(bool deserializing) : base(deserializing) { }
     75    protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(StorableConstructorFlag _) : base(_) { }
    7676    protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> original, Cloner cloner)
    7777      : base(original, cloner) {
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HEAL.Attic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3636  /// </summary>
    3737  [Item("SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    38   [StorableClass]
     38  [StorableType("6A84F46D-0CC3-400D-BC3B-D7C6A86D958D")]
    3939  public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, IIterationBasedOperator
    4040    where S : class, ISymbolicDataAnalysisSolution
     
    8383
    8484    [StorableConstructor]
    85     protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     85    protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
    8686    protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
    8787    public SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer()
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HEAL.Attic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3636  /// </summary>
    3737  [Item("SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    38   [StorableClass]
     38  [StorableType("892CE424-FAB0-4E78-8BC2-40BFD1F4A78A")]
    3939  public abstract class SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, ISymbolicDataAnalysisBoundedOperator
    4040    where S : class, ISymbolicDataAnalysisSolution
     
    7777
    7878    [StorableConstructor]
    79     protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     79    protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
    8080    protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
    8181    public SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer()
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisUsefulGenesAnalyzer.cs

    r13482 r17434  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
     22using HEAL.Attic;
    2523using HeuristicLab.Analysis;
    2624using HeuristicLab.Common;
     
    3129using HeuristicLab.Optimization;
    3230using HeuristicLab.Parameters;
    33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    34 
    35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers {
    36   [StorableClass]
     31using System;
     32using System.Collections.Generic;
     33using System.Linq;
     34
     35namespace HeuristicLab.Problems.DataAnalysis.Symbolic
     36{
    3737  [Item("SymbolicDataAnalysisUsefulGenesAnalyzer", "An analyzer which performs pruning by promoting genes in the population that outperform their containing individuals (the individuals are replaced by their subparts).")]
    38   public class SymbolicDataAnalysisUsefulGenesAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer {
     38  [StorableType("2CB2C4EE-9360-4C81-B354-926510E0DCD0")]
     39  public class SymbolicDataAnalysisUsefulGenesAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer
     40  {
    3941    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4042    private const string QualityParameterName = "Quality";
     
    130132    #endregion
    131133
    132     public SymbolicDataAnalysisUsefulGenesAnalyzer() {
     134    public SymbolicDataAnalysisUsefulGenesAnalyzer()
     135    {
    133136      #region Add parameters
    134137      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
     
    150153      : base(original, cloner) { }
    151154
    152     public override IDeepCloneable Clone(Cloner cloner) {
     155    public override IDeepCloneable Clone(Cloner cloner)
     156    {
    153157      return new SymbolicDataAnalysisUsefulGenesAnalyzer(this, cloner);
    154158    }
    155159
    156160    [StorableConstructor]
    157     protected SymbolicDataAnalysisUsefulGenesAnalyzer(bool deserializing)
    158       : base(deserializing) {
    159     }
     161    protected SymbolicDataAnalysisUsefulGenesAnalyzer(StorableConstructorFlag _) : base(_) { }
    160162
    161163    public bool EnabledByDefault {
     
    163165    }
    164166
    165     public override void InitializeState() {
     167    public override void InitializeState()
     168    {
    166169      UpdateCounter = 0;
    167170      base.InitializeState();
    168171    }
    169172
    170     public override IOperation Apply() {
     173    public override IOperation Apply()
     174    {
    171175      int generations = GenerationsParameter.ActualValue.Value;
    172176      #region Update counter & update interval
     
    174178        return base.Apply();
    175179      UpdateCounter++;
    176       if (UpdateCounter != UpdateInterval) {
     180      if (UpdateCounter != UpdateInterval)
     181      {
    177182        return base.Apply();
    178183      }
     
    196201      var count = (int)Math.Floor(trees.Length * PercentageOfBestSolutions);
    197202
    198       for (int i = trees.Length - 1; i >= trees.Length - count; --i) {
     203      for (int i = trees.Length - 1; i >= trees.Length - count; --i)
     204      {
    199205        if (random.NextDouble() > PruningProbability) continue;
    200206        var tree = trees[i];
     
    202208        var root = tree.Root.GetSubtree(0).GetSubtree(0);
    203209
    204         foreach (var s in root.IterateNodesPrefix().Skip(1)) {
     210        foreach (var s in root.IterateNodesPrefix().Skip(1))
     211        {
    205212          var r2 = EvaluateSubtree(s, interpreter, problemData, rows);
    206213          if (double.IsNaN(r2) || r2 <= quality) continue;
     
    224231      var results = ResultCollectionParameter.ActualValue;
    225232      DataTable table;
    226       if (results.ContainsKey(PromotedSubtreesResultName)) {
     233      if (results.ContainsKey(PromotedSubtreesResultName))
     234      {
    227235        table = (DataTable)results[PromotedSubtreesResultName].Value;
    228       } else {
     236      }
     237      else
     238      {
    229239        table = new DataTable(PromotedSubtreesResultName);
    230240        table.Rows.Add(new DataRow(PromotedSubtreesResultName));
     
    233243      table.Rows[PromotedSubtreesResultName].Values.Add(replacedTrees);
    234244
    235       if (results.ContainsKey(AverageQualityImprovementResultName)) {
     245      if (results.ContainsKey(AverageQualityImprovementResultName))
     246      {
    236247        table = (DataTable)results[AverageQualityImprovementResultName].Value;
    237       } else {
     248      }
     249      else
     250      {
    238251        table = new DataTable(AverageQualityImprovementResultName);
    239252        table.Rows.Add(new DataRow(AverageQualityImprovementResultName));
     
    242255      table.Rows[AverageQualityImprovementResultName].Values.Add(avgQualityImprovement);
    243256
    244       if (results.ContainsKey(AverageLengthReductionResultName)) {
     257      if (results.ContainsKey(AverageLengthReductionResultName))
     258      {
    245259        table = (DataTable)results[AverageLengthReductionResultName].Value;
    246       } else {
     260      }
     261      else
     262      {
    247263        table = new DataTable(AverageLengthReductionResultName);
    248264        table.Rows.Add(new DataRow(AverageLengthReductionResultName));
     
    254270    }
    255271
    256     private static double EvaluateSubtree(ISymbolicExpressionTreeNode subtree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IRegressionProblemData problemData, List<int> rows) {
     272    private static double EvaluateSubtree(ISymbolicExpressionTreeNode subtree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IRegressionProblemData problemData, List<int> rows)
     273    {
    257274      var linearInterpreter = (SymbolicDataAnalysisExpressionTreeLinearInterpreter)interpreter;
    258275      var dataset = problemData.Dataset;
  • branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs

    r16130 r17434  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Globalization;
    2524using System.Linq;
    2625using HeuristicLab.Analysis;
     
    3130using HeuristicLab.Optimization;
    3231using HeuristicLab.Parameters;
    33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     32using HEAL.Attic;
    3433
    3534namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3837  /// </summary>
    3938  [Item("SymbolicDataAnalysisVariableFrequencyAnalyzer", "Calculates the accumulated frequencies of variable-symbols over all trees in the population.")]
    40   [StorableClass]
     39  [StorableType("C7E9B375-6375-478F-8590-473BA567BA90")]
    4140  public sealed class SymbolicDataAnalysisVariableFrequencyAnalyzer : SymbolicDataAnalysisAnalyzer {
    4241    private const string VariableFrequenciesParameterName = "VariableFrequencies";
     
    7069    #endregion
    7170    [StorableConstructor]
    72     private SymbolicDataAnalysisVariableFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
     71    private SymbolicDataAnalysisVariableFrequencyAnalyzer(StorableConstructorFlag _) : base(_) { }
    7372    private SymbolicDataAnalysisVariableFrequencyAnalyzer(SymbolicDataAnalysisVariableFrequencyAnalyzer original, Cloner cloner)
    7473      : base(original, cloner) {
Note: See TracChangeset for help on using the changeset viewer.