Changeset 11927


Ignore:
Timestamp:
02/06/15 00:45:30 (8 years ago)
Author:
bburlacu
Message:

#1772: Fixed compilation errors and removed leftover similarity calculators, re-added ISymbolicExpressionTreeNodeSimilarityComparer interface and PhenotypicSimilarityCalculator.

Location:
branches/HeuristicLab.EvolutionTracking
Files:
1 deleted
10 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r11638 r11927  
    199199    <Compile Include="Interfaces\ISymbolicExpressionTreeGrammar.cs" />
    200200    <Compile Include="Interfaces\ISymbolicExpressionTreeNodeComparer.cs" />
    201     <Compile Include="Interfaces\ISymbolicExpressionTreeNodeSimilarityComparer.cs" />
     201    <Compile Include="Interfaces\ISymbolicExpressionTreeNodeEqualityComparer.cs" />
    202202    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeArchitectureAlteringOperator.cs" />
    203203    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeGrammarBasedOperator.cs" />
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs

    r11925 r11927  
    33
    44namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    5   public interface ISymbolicExpressionTreeNodeSimilarityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem {
     5  public interface ISymbolicExpressionTreeNodeEqualityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem {
    66    bool MatchConstantValues { get; set; }
    77    bool MatchVariableWeights { get; set; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs

    r11925 r11927  
    3737  [Content(typeof(IGenealogyGraph<ISymbolicExpressionTree>), IsDefaultView = true)]
    3838  public partial class SymbolicDataAnalysisGenealogyGraphView : SymbolicDataAnalysisGenealogyGraphViewDesignable {
    39     private readonly ISymbolicExpressionTreeNodeSimilarityComparer comparer;
     39    private readonly ISymbolicExpressionTreeNodeEqualityComparer comparer;
    4040
    4141    public SymbolicDataAnalysisGenealogyGraphView() {
    4242      InitializeComponent();
    43       comparer = new SymbolicExpressionTreeNodeSimilarityComparer();
     43      comparer = new SymbolicExpressionTreeNodeEqualityComparer();
    4444      viewHost.ViewType = typeof(GraphicalSymbolicExpressionTreeView);
    4545    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs

    r11482 r11927  
    4545      set {
    4646        MatchConstantValuesParameter.Value.Value = value;
    47         ((BottomUpSimilarityCalculator)SimilarityCalculator).MatchConstantValues = value;
     47        ((SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculator).MatchConstantValues = value;
    4848      }
    4949    }
     
    5353      set {
    5454        MatchVariableWeightsParameter.Value.Value = value;
    55         ((BottomUpSimilarityCalculator)SimilarityCalculator).MatchVariableWeights = value;
     55        ((SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculator).MatchVariableWeights = value;
    5656      }
    5757    }
     
    6969
    7070    public SymbolicDataAnalysisBottomUpDiversityAnalyzer() {
    71       SimilarityCalculator = new BottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
     71      SimilarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
    7272      Parameters.Add(new ValueParameter<BoolValue>(MatchConstantValuesParameterName, "Specifies if the similarity calculator should match constant values.", new BoolValue(true)));
    7373      Parameters.Add(new ValueParameter<BoolValue>(MatchVariableWeightsParameterName, "Specifies if the similarity calculator should match variable weights", new BoolValue(true)));
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer.cs

    r11482 r11927  
    3232
    3333    public SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer() {
    34       SimilarityCalculator = new MaxCommonSubtreeSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
     34      SimilarityCalculator = new SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
    3535    }
    3636  }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs

    r11458 r11927  
    5454    public SymbolicDataAnalysisExpressionDiversityPreservingCrossover() {
    5555      Parameters.Add(new ValueLookupParameter<PercentValue>(InternalCrossoverPointProbabilityParameterName, "The probability to select an internal crossover point (instead of a leaf node).", new PercentValue(0.9)));
    56       Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionSimilarityCalculator>(SimilarityCalculatorParameterName, "The similarity calculator", new BottomUpSimilarityCalculator()));
     56      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionSimilarityCalculator>(SimilarityCalculatorParameterName, "The similarity calculator", new SymbolicExpressionTreeBottomUpSimilarityCalculator()));
    5757    }
    5858
     
    7878      var left = actualRoot.GetSubtree(0);
    7979      var right = actualRoot.GetSubtree(1);
    80       var bus = (BottomUpSimilarityCalculator)similarityCalculator;
     80      var bus = (SymbolicExpressionTreeBottomUpSimilarityCalculator)similarityCalculator;
    8181      var map = bus.ComputeBottomUpMapping(left, right);
    8282
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r11926 r11927  
    204204    <Compile Include="Importer\Token.cs" />
    205205    <Compile Include="Interfaces\IModelBacktransformator.cs" />
    206     <Compile Include="SimilarityCalculators\BottomUpSimilarityCalculator.cs" />
    207     <Compile Include="SimilarityCalculators\MaxCommonSubtreeSimilarityCalculator.cs" />
    208     <Compile Include="SimilarityCalculators\PhenotypicSimilarityCalculator.cs" />
     206    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionSimilarityCalculator.cs" />
     207    <Compile Include="TreeMatching\SymbolicExpressionTreePhenotypicSimilarityCalculator.cs" />
    209208    <Compile Include="SymbolicExpressionTreeBacktransformator.cs" />
    210209    <Compile Include="SlidingWindow\GenerationalSlidingWindowAnalyzer.cs" />
     
    312311    <Compile Include="Symbols\VariableConditionTreeNode.cs" />
    313312    <Compile Include="Symbols\VariableTreeNode.cs" />
     313    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs" />
     314    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs" />
     315    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs" />
     316    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs" />
    314317    <Compile Include="Tracking\TraceCalculator.cs" />
    315318    <Compile Include="TransformationToSymbolicTreeMapper.cs" />
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs

    r11921 r11927  
    3434  [StorableClass]
    3535  [Item("SymbolicExpressionTreeBottomUpSimilarityCalculator", "A similarity calculator which uses the tree bottom-up distance as a similarity metric.")]
    36   public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
     36  public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator, ISymbolicDataAnalysisExpressionSimilarityCalculator {
    3737    private readonly HashSet<string> commutativeSymbols = new HashSet<string> { "Addition", "Multiplication", "Average", "And", "Or", "Xor" };
    3838    public bool MatchVariableWeights { get; set; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs

    r11910 r11927  
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3131  public static class SymbolicExpressionTreeMatching {
    32     public static bool ContainsSubtree(this ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, SymbolicExpressionTreeNodeEqualityComparer comparer) {
     32    public static bool ContainsSubtree(this ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
    3333      return FindMatches(root, subtree, comparer).Any();
    3434    }
    35     public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode subtree, SymbolicExpressionTreeNodeEqualityComparer comparer) {
     35    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
    3636      return FindMatches(tree.Root, subtree, comparer);
    3737    }
    3838
    39     public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, SymbolicExpressionTreeNodeEqualityComparer comp) {
     39    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comp) {
    4040      var fragmentLength = subtree.GetLength();
    4141      // below, we use ">=" for Match(n, subtree, comp) >= fragmentLength because in case of relaxed conditions,
     
    5252    /// </summary>
    5353    /// <returns>Number of pairs that were matched</returns>
    54     public static int Match(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b, ISymbolicExpressionTreeNodeSimilarityComparer comp) {
     54    public static int Match(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b, ISymbolicExpressionTreeNodeEqualityComparer comp) {
    5555      if (!comp.Equals(a, b)) return 0;
    5656      int m = a.SubtreeCount;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs

    r11910 r11927  
    3030  [StorableClass]
    3131  [Item("SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator", "A similarity calculator based on the size of the maximum common subtree between two trees")]
    32   public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
     32  public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator, ISymbolicDataAnalysisExpressionSimilarityCalculator {
    3333    [Storable]
    3434    private readonly SymbolicExpressionTreeNodeEqualityComparer comparer;
     
    8585    }
    8686
    87     public static double MaxCommonSubtreeSimilarity(ISymbolicExpressionTree a, ISymbolicExpressionTree b, ISymbolicExpressionTreeNodeSimilarityComparer comparer) {
     87    public static double MaxCommonSubtreeSimilarity(ISymbolicExpressionTree a, ISymbolicExpressionTree b, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
    8888      int max = 0;
    8989      var rootA = a.Root.GetSubtree(0).GetSubtree(0);
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs

    r11910 r11927  
    2828  [Item("SymbolicExpressionTreeNodeEqualityComparer", "An operator that checks node equality based on different similarity measures.")]
    2929  [StorableClass]
    30   public class SymbolicExpressionTreeNodeEqualityComparer : Item, ISymbolicExpressionTreeNodeSimilarityComparer {
     30  public class SymbolicExpressionTreeNodeEqualityComparer : Item, ISymbolicExpressionTreeNodeEqualityComparer {
    3131    [StorableConstructor]
    3232    protected SymbolicExpressionTreeNodeEqualityComparer(bool deserializing) : base(deserializing) { }
Note: See TracChangeset for help on using the changeset viewer.