Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5574


Ignore:
Timestamp:
02/28/11 20:31:09 (13 years ago)
Author:
gkronber
Message:

#1418 Added test projects for data-analysis and symbolic data-analysis plugin. Moved grammars to version 3.4. Fixed bugs in interpretation and simplification of 'not' symbols.

Location:
branches/DataAnalysis Refactoring
Files:
15 added
4 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab 3.3.sln

    r5573 r5574  
    369369EndProject
    370370Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.ExternalEvaluation.GP.Views-3.4", "HeuristicLab.Problems.ExternalEvaluation.GP.Views\3.4\HeuristicLab.Problems.ExternalEvaluation.GP.Views-3.4.csproj", "{A0AF4D54-6A04-483E-A26D-97F8C1141526}"
     371EndProject
     372Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Tests-3.4", "HeuristicLab.Problems.DataAnalysis\3.4\Tests\HeuristicLab.Problems.DataAnalysis.Tests-3.4.csproj", "{F5013F6B-5A2D-4741-8FC9-31A6968E9C41}"
     373EndProject
     374Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Tests-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\Tests\HeuristicLab.Problems.DataAnalysis.Symbolic.Tests-3.4.csproj", "{2A976109-67B9-4FF0-89DE-A26A8307A1CE}"
    371375EndProject
    372376Global
     
    16911695    {A0AF4D54-6A04-483E-A26D-97F8C1141526}.Release|x86.ActiveCfg = Release|x86
    16921696    {A0AF4D54-6A04-483E-A26D-97F8C1141526}.Release|x86.Build.0 = Release|x86
     1697    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     1698    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Debug|Any CPU.Build.0 = Debug|Any CPU
     1699    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Debug|x64.ActiveCfg = Debug|x64
     1700    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Debug|x64.Build.0 = Debug|x64
     1701    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Debug|x86.ActiveCfg = Debug|x86
     1702    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Debug|x86.Build.0 = Debug|x86
     1703    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Release|Any CPU.ActiveCfg = Release|Any CPU
     1704    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Release|Any CPU.Build.0 = Release|Any CPU
     1705    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Release|x64.ActiveCfg = Release|x64
     1706    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Release|x64.Build.0 = Release|x64
     1707    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Release|x86.ActiveCfg = Release|x86
     1708    {F5013F6B-5A2D-4741-8FC9-31A6968E9C41}.Release|x86.Build.0 = Release|x86
     1709    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     1710    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
     1711    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Debug|x64.ActiveCfg = Debug|x64
     1712    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Debug|x64.Build.0 = Debug|x64
     1713    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Debug|x86.ActiveCfg = Debug|x86
     1714    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Debug|x86.Build.0 = Debug|x86
     1715    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
     1716    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Release|Any CPU.Build.0 = Release|Any CPU
     1717    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Release|x64.ActiveCfg = Release|x64
     1718    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Release|x64.Build.0 = Release|x64
     1719    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Release|x86.ActiveCfg = Release|x86
     1720    {2A976109-67B9-4FF0-89DE-A26A8307A1CE}.Release|x86.Build.0 = Release|x86
    16931721  EndGlobalSection
    16941722  GlobalSection(SolutionProperties) = preSolution
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs

    r5572 r5574  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
     27
    2928namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3029  [StorableClass]
     
    5150      constant.MinValue = -20;
    5251      constant.MaxValue = 20;
    53       var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
     52      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
    5453
    5554      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol };
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs

    r5572 r5574  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
     27
    2928namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3029  [StorableClass]
     
    7877      constant.MinValue = -20;
    7978      constant.MaxValue = 20;
    80       var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
     79      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
    8180      var laggedVariable = new LaggedVariable();
    8281      laggedVariable.InitialFrequency = 0.0;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r5572 r5574  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    2827using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    29 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
    3028namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3129  [StorableClass]
     
    7876      constant.MinValue = -20;
    7977      constant.MaxValue = 20;
    80       var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
     78      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
    8179      var laggedVariable = new LaggedVariable();
    8280
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r5571 r5574  
    116116    </Compile>
    117117    <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" />
     118    <Compile Include="Grammars\ArithmeticExpressionGrammar.cs" />
     119    <Compile Include="Grammars\FullFunctionalExpressionGrammar.cs" />
     120    <Compile Include="Grammars\TypeCoherentExpressionGrammar.cs" />
    118121    <Compile Include="Interfaces\ISymbolicDataAnalysisMultiObjectiveAnalyzer.cs" />
    119122    <Compile Include="Interfaces\ISymbolicDataAnalysisSingleObjectiveAnalyzer.cs" />
     
    269272    </BootstrapperPackage>
    270273  </ItemGroup>
    271   <ItemGroup>
    272     <Folder Include="Grammars\" />
    273   </ItemGroup>
     274  <ItemGroup />
    274275  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    275276  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r5571 r5574  
    303303          }
    304304        case OpCodes.NOT: {
    305             return Evaluate(dataset, ref row, state) > 0.0 ? 1.0 : -1.0;
     305            return Evaluate(dataset, ref row, state) > 0.0 ? -1.0 : 1.0;
    306306          }
    307307        case OpCodes.GT: {
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs

    r5571 r5574  
    368368    #region low level tree restructuring
    369369    private ISymbolicExpressionTreeNode MakeNot(ISymbolicExpressionTreeNode t) {
    370       if (IsConstant(t.GetSubTree(0))) {
     370      if (IsConstant(t)) {
    371371        var constNode = t as ConstantTreeNode;
    372         if (constNode.Value > 0) return MakeConstant(1.0);
    373         else return MakeConstant(-1.0);
    374       } else if (IsNot(t.GetSubTree(0))) {
    375         return t.GetSubTree(0).GetSubTree(0);
    376       } else if (!IsBoolean(t.GetSubTree(0))) {
     372        if (constNode.Value > 0) return MakeConstant(-1.0);
     373        else return MakeConstant(1.0);
     374      } else if (IsNot(t)) {
     375        return t.GetSubTree(0);
     376      } else if (!IsBoolean(t)) {
    377377        var gtNode = gtSymbol.CreateTreeNode();
    378         gtNode.AddSubTree(t.GetSubTree(0)); gtNode.AddSubTree(MakeConstant(0.0));
    379         return gtNode;
    380       } else return t;
     378        gtNode.AddSubTree(t); gtNode.AddSubTree(MakeConstant(0.0));
     379        var notNode = notSymbol.CreateTreeNode();
     380        notNode.AddSubTree(gtNode);
     381        return notNode;
     382      } else {
     383        var notNode = notSymbol.CreateTreeNode();
     384        notNode.AddSubTree(t);
     385        return notNode;
     386      }
    381387    }
    382388
Note: See TracChangeset for help on using the changeset viewer.