Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/11 20:31:09 (14 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/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
9 added
3 edited
3 copied

Legend:

Unmodified
Added
Removed
  • 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.