Changeset 5574 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Timestamp:
- 02/28/11 20:31:09 (14 years ago)
- 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 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 27 29 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 30 29 [StorableClass] … … 51 50 constant.MinValue = -20; 52 51 constant.MaxValue = 20; 53 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic. Symbols.Variable();52 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 54 53 55 54 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 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 27 29 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 30 29 [StorableClass] … … 78 77 constant.MinValue = -20; 79 78 constant.MaxValue = 20; 80 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic. Symbols.Variable();79 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 81 80 var laggedVariable = new LaggedVariable(); 82 81 laggedVariable.InitialFrequency = 0.0; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r5572 r5574 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;30 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 31 29 [StorableClass] … … 78 76 constant.MinValue = -20; 79 77 constant.MaxValue = 20; 80 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic. Symbols.Variable();78 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 81 79 var laggedVariable = new LaggedVariable(); 82 80 -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r5571 r5574 116 116 </Compile> 117 117 <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" /> 118 <Compile Include="Grammars\ArithmeticExpressionGrammar.cs" /> 119 <Compile Include="Grammars\FullFunctionalExpressionGrammar.cs" /> 120 <Compile Include="Grammars\TypeCoherentExpressionGrammar.cs" /> 118 121 <Compile Include="Interfaces\ISymbolicDataAnalysisMultiObjectiveAnalyzer.cs" /> 119 122 <Compile Include="Interfaces\ISymbolicDataAnalysisSingleObjectiveAnalyzer.cs" /> … … 269 272 </BootstrapperPackage> 270 273 </ItemGroup> 271 <ItemGroup> 272 <Folder Include="Grammars\" /> 273 </ItemGroup> 274 <ItemGroup /> 274 275 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 275 276 <!-- 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 303 303 } 304 304 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; 306 306 } 307 307 case OpCodes.GT: { -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs
r5571 r5574 368 368 #region low level tree restructuring 369 369 private ISymbolicExpressionTreeNode MakeNot(ISymbolicExpressionTreeNode t) { 370 if (IsConstant(t .GetSubTree(0))) {370 if (IsConstant(t)) { 371 371 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)) { 377 377 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 } 381 387 } 382 388
Note: See TracChangeset
for help on using the changeset viewer.