Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/12 09:56:56 (12 years ago)
Author:
bburlacu
Message:

#1772: Moved tree matching functionality in separate class, implemented new tree fragments analyzer. Fixed bug in GetCutIndex method.

Location:
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs

    r7522 r7785  
    6464      }
    6565    }
     66
     67    public static CutPoint GetCutPoint(ISymbolicExpressionTree parent, ISymbolicExpressionTree child) {
     68      return GetCutPoint(parent.Root, child.Root);
     69    }
     70
     71    public static CutPoint GetCutPoint(ISymbolicExpressionTree parent, ISymbolicExpressionTreeNode child) {
     72      return GetCutPoint(parent.Root, child);
     73    }
     74
     75    public static CutPoint GetCutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTree child) {
     76      return GetCutPoint(parent, child.Root);
     77    }
     78
     79    // child is the result of a genetic operation on parent
     80    // this method returns the index on which the two individuals start to differ
     81    public static CutPoint GetCutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
     82      var e1 = parent.IterateNodesPostfix().GetEnumerator();
     83      var e2 = child.IterateNodesPostfix().GetEnumerator();
     84      int pos = -1;
     85      var comparer = new SymbolicExpressionTreeNodeComparer((int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact);
     86      while (e1.MoveNext() && e2.MoveNext())
     87        if (comparer.Equals(e1.Current, e2.Current))
     88          ++pos;
     89      return pos == -1 ? null : new CutPoint(parent, pos);
     90    }
    6691  }
    6792}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r7479 r7785  
    133133      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    134134    </Reference>
     135    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     136      <SpecificVersion>False</SpecificVersion>
     137      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
     138    </Reference>
    135139    <Reference Include="HeuristicLab.Random-3.3">
    136140      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
     
    174178    </Compile>
    175179    <Compile Include="Creators\RampedHalfAndHalfTreeCreator.cs" />
     180    <Compile Include="Crossovers\AssortativeSymbolicExpressionTreeCrossover.cs" />
    176181    <Compile Include="Crossovers\TracingSymbolicExpressionTreeCrossover.cs" />
    177182    <Compile Include="Interfaces\IReadOnlySymbol.cs" />
     
    206211    <Compile Include="SymbolicExpressionGrammar.cs" />
    207212    <Compile Include="SymbolicExpressionTreeGrammar.cs" />
     213    <Compile Include="SymbolicExpressionTreeMatching.cs" />
    208214    <Compile Include="SymbolicExpressionTreeTopLevelNode.cs" />
    209215    <Compile Include="Crossovers\SubtreeCrossover.cs">
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj.user

    r7514 r7785  
    77  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
    88    <StartAction>Program</StartAction>
    9     <StartProgram>C:\Users\bburlacu\Desktop\HL-Core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
     9    <StartProgram>C:\Users\Bogdan\Desktop\Trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
    1010  </PropertyGroup>
    1111  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs

    r7779 r7785  
    2626
    2727namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    28   [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7522")]
     28  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7779")]
    2929  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.