Changeset 10278


Ignore:
Timestamp:
01/04/14 14:26:02 (8 years ago)
Author:
bburlacu
Message:

#1772: Implemented generic genealogy analyzer (should work with any encoding provided the proper wiring is performed in the problem class), and before/after operators for creation, mutation and crossover.

Location:
branches/HeuristicLab.EvolutionTracking
Files:
15 added
1 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs

    r9456 r10278  
    9494    }
    9595
    96     public override IOperation Apply() {
     96    public override IOperation InstrumentedApply() {
    9797      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
    9898        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
     
    104104          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
    105105      }
    106       return base.Apply();
     106      return base.InstrumentedApply();
    107107    }
    108108
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs

    r9456 r10278  
    9494    }
    9595
    96     public override IOperation Apply() {
     96    public override IOperation InstrumentedApply() {
    9797      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
    9898        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
     
    104104          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
    105105      }
    106       return base.Apply();
     106      return base.InstrumentedApply();
    107107    }
    108108
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs

    r9456 r10278  
    8787    }
    8888
    89     public override IOperation Apply() {
     89    public override IOperation InstrumentedApply() {
    9090      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
    9191        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
     
    9696        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
    9797      }
    98       return base.Apply();
     98      return base.InstrumentedApply();
    9999    }
    100100
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs

    r9456 r10278  
    9595    }
    9696
    97     public override IOperation Apply() {
     97    public override IOperation InstrumentedApply() {
    9898      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
    9999        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
     
    105105          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
    106106      }
    107       return base.Apply();
     107      return base.InstrumentedApply();
    108108    }
    109109
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs

    r9456 r10278  
    5454    }
    5555
    56     public override IOperation Apply() {
     56    public override IOperation InstrumentedApply() {
    5757      SymbolicExpressionTree = Create(Random);
    58       return base.Apply();
     58      return base.InstrumentedApply();
    5959    }
    6060
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs

    r9456 r10278  
    6363    }
    6464
    65     public sealed override IOperation Apply() {
     65    public sealed override IOperation InstrumentedApply() {
    6666      if (Parents.Length != 2)
    6767        throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators.");
     
    7070
    7171      Child = result;
    72       return base.Apply();
     72      return base.InstrumentedApply();
    7373    }
    7474
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs

    r9456 r10278  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Parameters;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    5554    }
    5655
    57     public sealed override IOperation Apply() {
     56    public sealed override IOperation InstrumentedApply() {
    5857      ISymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
    5958      Manipulate(RandomParameter.ActualValue, tree);
    6059
    61       return base.Apply();
     60      return base.InstrumentedApply();
    6261    }
    6362
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs

    r9456 r10278  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Operators;
    2625using HeuristicLab.Optimization;
     
    3433  [Item("SymbolicExpressionTreeOperator", "A base class for operators for symbolic expression trees.")]
    3534  [StorableClass]
    36   public abstract class SymbolicExpressionTreeOperator : SingleSuccessorOperator, IStochasticOperator, ISymbolicExpressionTreeOperator {
     35  public abstract class SymbolicExpressionTreeOperator : InstrumentedOperator, IStochasticOperator, ISymbolicExpressionTreeOperator {
    3736    private const string RandomParameterName = "Random";
    3837
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Arc.cs

    r10271 r10278  
    1 using HeuristicLab.Common;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using HeuristicLab.Common;
    223using HeuristicLab.Core;
    324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs

    r10271 r10278  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929
    3030namespace HeuristicLab.EvolutionTracking {
    31   [Item("", "")]
     31  [Item("DirectedGraph", "Generic class representing a directed graph with custom vertices and content")]
    3232  [StorableClass]
    3333  public class DirectedGraph<TVertex> : Item, IDirectedGraph<TVertex> where TVertex : class,IVertex {
    3434    [Storable]
    35     protected readonly List<TVertex> nodes; // graph will consist of a set of nodes of type T
     35    protected readonly List<TVertex> nodes; // for performance reasons, maybe this should be a linked list (fast remove)
    3636    public List<TVertex> Nodes {
    3737      get { return nodes; }
     
    4646    protected DirectedGraph(DirectedGraph<TVertex> original, Cloner cloner)
    4747      : base(original, cloner) {
    48       nodes = new List<TVertex>(original.Nodes); // bburlacu: maybe the list should be empty
     48      nodes = new List<TVertex>(original.Nodes);
    4949    }
    5050    public override IDeepCloneable Clone(Cloner cloner) {
     
    116116      base.Clear();
    117117    }
    118 
    119     /// <summary>
    120     /// Adds a node representing an individual
    121     /// </summary>
    122     /// <param name="node">The node to add</param>
    123118    public override void AddVertex(TVertex vertex) {
    124119      if (contentMap.ContainsKey(vertex.Content)) {
     
    130125    }
    131126
    132     /// <summary>
    133     /// Remove a node from the graph along with edges associated with it
    134     /// </summary>
    135     /// <param name="t">The graph node</param>
    136     public override void RemoveVertex(TVertex t) {
    137       if (contentMap.ContainsKey(t.Content)) {
    138         contentMap[t.Content].Remove(t);
     127    public override void RemoveVertex(TVertex vertex) {
     128      if (contentMap.ContainsKey(vertex.Content)) {
     129        contentMap[vertex.Content].Remove(vertex);
    139130      }
     131      base.RemoveVertex(vertex);
    140132    }
    141133  }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IArc.cs

    r10271 r10278  
    1 namespace HeuristicLab.EvolutionTracking {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.EvolutionTracking {
    223  public interface IArc {
    324    IVertex Source { get; set; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IDirectedGraph.cs

    r10271 r10278  
    3838    where TVertex : class, IVertex
    3939    where TContent : class, IItem {
    40     bool Contains(TContent content); // graph contains specific node?
     40    bool Contains(TContent content); // graph contains node with given content?
    4141  }
    4242}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Vertex.cs

    r10271 r10278  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs

    r10271 r10278  
    1 
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
    222using System;
    323using System.Collections.Generic;
     
    3555      Ranks = new Dictionary<double, LinkedList<TVertex>>();
    3656    }
     57    public override void AddVertex(TVertex vertex) {
     58      if (!Ranks.ContainsKey(vertex.Rank)) {
     59        Ranks[vertex.Rank] = new LinkedList<TVertex>();
     60      }
     61      Ranks[vertex.Rank].AddLast(vertex);
     62      base.AddVertex(vertex);
     63    }
     64    public override void RemoveVertex(TVertex vertex) {
     65      if (Ranks.ContainsKey(vertex.Rank)) {
     66        Ranks[vertex.Rank].Remove(vertex);
     67      }
     68      base.RemoveVertex(vertex);
     69    }
     70    // updated event
     71    public event EventHandler GraphUpdated;
     72    private void OnGraphUpdated(object sender, EventArgs args) {
     73      var updated = GraphUpdated;
     74      if (updated != null) updated(sender, args);
     75    }
     76  }
    3777
     78  [StorableClass]
     79  [Item("GenealogyGraph",
     80    "A class representing a genealogy graph (of a population of individuals) in which each vertex stores a content.")]
     81  public class GenealogyGraph<TVertex, TContent> : DirectedGraph<TVertex, TContent>, IGenealogyGraph<TVertex, TContent>
     82    where TVertex : class, IGenealogyGraphNode<TContent>
     83    where TContent : class, IItem {
     84    [Storable]
     85    private Dictionary<double, LinkedList<TVertex>> ranks;
     86    public Dictionary<double, LinkedList<TVertex>> Ranks {
     87      get { return ranks; }
     88      set { ranks = value; }
     89    }
     90    protected GenealogyGraph(GenealogyGraph<TVertex, TContent> original, Cloner cloner)
     91      : base(original, cloner) {
     92    }
     93    public override IDeepCloneable Clone(Cloner cloner) {
     94      return new GenealogyGraph<TVertex, TContent>(this, cloner);
     95    }
     96    public GenealogyGraph() {
     97      Ranks = new Dictionary<double, LinkedList<TVertex>>();
     98    }
     99    public override void AddVertex(TVertex vertex) {
     100      if (!Ranks.ContainsKey(vertex.Rank)) {
     101        Ranks[vertex.Rank] = new LinkedList<TVertex>();
     102      }
     103      Ranks[vertex.Rank].AddLast(vertex);
     104      base.AddVertex(vertex);
     105    }
     106    public override void RemoveVertex(TVertex vertex) {
     107      if (Ranks.ContainsKey(vertex.Rank)) {
     108        Ranks[vertex.Rank].Remove(vertex);
     109      }
     110      base.RemoveVertex(vertex);
     111    }
     112    // updated event
    38113    public event EventHandler GraphUpdated;
    39114    private void OnGraphUpdated(object sender, EventArgs args) {
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs

    r10271 r10278  
    1 
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
    222using HeuristicLab.Common;
    323using HeuristicLab.Core;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs

    r10271 r10278  
    1 
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
    222using System.Collections.Generic;
    323using System.Linq;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs

    r10271 r10278  
    1 using System.Collections.Generic;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Collections.Generic;
     23using HeuristicLab.Core;
    224
    325namespace HeuristicLab.EvolutionTracking {
     26
     27
     28  public interface IGenealogyGraph : IGenealogyGraph<IGenealogyGraphNode> {
     29  }
    430  public interface IGenealogyGraph<TVertex> : IDirectedGraph<TVertex> where TVertex : class, IGenealogyGraphNode {
    531    Dictionary<double, LinkedList<TVertex>> Ranks { get; set; }
    632  }
    733
    8   public interface IGenealogyGraph : IGenealogyGraph<IGenealogyGraphNode> {
     34  public interface IGenealogyGraph<TVertex, in TContent> : IDirectedGraph<TVertex, TContent>, IGenealogyGraph<TVertex>
     35    where TVertex : class, IGenealogyGraphNode<TContent>
     36    where TContent : class, IItem {
     37
     38    List<TVertex> this[TContent content] { get; }
    939  }
    1040}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs

    r10271 r10278  
    1 namespace HeuristicLab.EvolutionTracking {
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22namespace HeuristicLab.EvolutionTracking {
    223  public interface IGenealogyGraphArc : IArc {
    324    new IGenealogyGraphNode Source { get; set; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs

    r10271 r10278  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj

    r10269 r10278  
    131131  </ItemGroup>
    132132  <ItemGroup>
     133    <Compile Include="Analyzers\GenealogyAnalyzer.cs" />
    133134    <Compile Include="DirectedGraph\Arc.cs" />
    134135    <Compile Include="DirectedGraph\DirectedGraph.cs" />
     
    137138    <Compile Include="DirectedGraph\Interfaces\IVertex.cs" />
    138139    <Compile Include="DirectedGraph\Vertex.cs" />
    139     <Compile Include="EvolutionTrackingOperators\EvolutionTrackingAfterCreationOperator.cs" />
    140     <Compile Include="EvolutionTrackingOperators\EvolutionTrackingAfterCrossoverOperator.cs" />
    141     <Compile Include="EvolutionTrackingOperators\EvolutionTrackingOperator.cs" />
     140    <Compile Include="Operators\AfterCrossoverOperator.cs" />
     141    <Compile Include="Operators\AfterManipulatorOperator.cs" />
     142    <Compile Include="Operators\AfterSolutionCreatorOperator.cs" />
     143    <Compile Include="Operators\BeforeManipulatorOperator.cs" />
     144    <Compile Include="Operators\EvolutionTrackingOperator.cs" />
    142145    <Compile Include="FPGraph.cs">
    143146      <SubType>Code</SubType>
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Plugin.cs

    r10264 r10278  
    2222using HeuristicLab.PluginInfrastructure;
    2323
    24 namespace HeuristicLab.EvolutionaryTracking {
    25   [Plugin("HeuristicLab.EvolutionaryTracking", "Provides operators and related classes for tracking the evolution within a GA.", "3.4.2.7439")]
     24namespace HeuristicLab.EvolutionTracking {
     25  [Plugin("HeuristicLab.EvolutionTracking", "Provides operators and related classes for tracking the evolution within a GA.", "3.4.2.7439")]
    2626  [PluginFile("HeuristicLab.EvolutionaryTracking-3.4.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Analysis", "3.3")]
     
    4242  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4343
    44   public class HeuristicLabEvolutionaryTrackingPlugin : PluginBase {
     44  public class HeuristicLabEvolutionTrackingPlugin : PluginBase {
    4545  }
    4646}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r10269 r10278  
    332332    </ProjectReference>
    333333  </ItemGroup>
     334  <ItemGroup>
     335    <Folder Include="Tracking\" />
     336  </ItemGroup>
    334337  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    335338  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r9830 r10278  
    2828using HeuristicLab.Data;
    2929using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     30using HeuristicLab.EvolutionTracking;
    3031using HeuristicLab.Optimization;
    3132using HeuristicLab.Parameters;
     
    3334using HeuristicLab.PluginInfrastructure;
    3435using HeuristicLab.Problems.Instances;
     36
     37using TGraph = HeuristicLab.EvolutionTracking.IGenealogyGraph<HeuristicLab.EvolutionTracking.GenealogyGraphNode<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>,
     38                                                              HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>;
     39using TVertex = HeuristicLab.EvolutionTracking.GenealogyGraphNode<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>;
    3540
    3641namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    231236      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
    232237      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
     238      Operators.Add(new GenealogyAnalyzer<TGraph, TVertex, ISymbolicExpressionTree>());
    233239      ParameterizeOperators();
    234240    }
     
    350356        op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    351357      }
     358      // add tracking analyzer
     359      foreach (var op in operators.OfType<GenealogyAnalyzer<TGraph, TVertex, ISymbolicExpressionTree>>()) {
     360        var crossover = operators.OfType<ISymbolicExpressionTreeCrossover>().First();
     361        op.CrossoverParentsParameterName = crossover.ParentsParameter.Name;
     362        op.CrossoverChildParameterName = crossover.ChildParameter.Name;
     363        var manipulator = operators.OfType<ISymbolicExpressionTreeManipulator>().First();
     364        op.ManipulatorChildParameterName = manipulator.SymbolicExpressionTreeParameter.Name;
     365        var creator = operators.OfType<ISymbolicExpressionTreeCreator>().First();
     366        op.SolutionCreatorIndividualParameterName = creator.SymbolicExpressionTreeParameter.Name;
     367      }
    352368    }
    353369
Note: See TracChangeset for help on using the changeset viewer.