- Timestamp:
- 04/16/10 15:22:57 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic
- Files:
-
- 5 deleted
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs
r3338 r3373 20 20 #endregion 21 21 22 23 22 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 24 23 using System.Collections.Generic; … … 28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.GeneralSymbols; 30 using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Symbols;31 29 using HeuristicLab.Data; 32 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic { 30 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 33 32 [StorableClass] 34 33 [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")] … … 45 44 46 45 [Storable] 47 private HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols.Variable variableSymbol;46 private HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable variableSymbol; 48 47 49 48 public ArithmeticExpressionGrammar() … … 58 57 var div = new Division(); 59 58 var constant = new Constant(); 60 variableSymbol = new HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols.Variable();59 variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable(); 61 60 62 61 var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol }; 63 62 var functionSymbols = new List<Symbol>() { add, sub, mul, div }; 63 64 64 foreach (var symb in allSymbols) 65 65 AddSymbol(symb); -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionEvaluator.cs
r3294 r3373 27 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.GeneralSymbols; 29 using HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols;29 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 30 30 31 namespace HeuristicLab.Problems.DataAnalysis. Regression.Symbolic {31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 32 32 [StorableClass] 33 33 [Item("SimpleArithmeticExpressionEvaluator", "Default evaluator for arithmetic symbolic expression trees.")] … … 82 82 } 83 83 case CodeSymbol.Dynamic: { 84 if (currentInstr.dynamicNode is VariableTreeNode) {85 var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode;84 var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode; 85 if (variableTreeNode != null) { 86 86 return dataset[row, dataset.GetVariableIndex(variableTreeNode.VariableName)] * variableTreeNode.Weight; 87 } else if (currentInstr.dynamicNode is ConstantTreeNode) { 88 return ((ConstantTreeNode)currentInstr.dynamicNode).Value; 87 } 88 var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode; 89 if (constTreeNode != null) { 90 return constTreeNode.Value; 89 91 } else throw new NotSupportedException(); 90 92 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs
r3294 r3373 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Operators; 25 using HeuristicLab.Random;26 25 using HeuristicLab.Data; 27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 27 using HeuristicLab.Parameters; 29 namespace HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols {28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 30 29 [StorableClass] 31 30 [Item("Constant", "Represents a constant value.")] -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs
r3294 r3373 27 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Random; 29 namespace HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols {29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 30 30 [StorableClass] 31 31 public sealed class ConstantTreeNode : SymbolicExpressionTreeTerminalNode { -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs
r3294 r3373 29 29 using System.Collections.Generic; 30 30 using System; 31 namespace HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols {31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 32 32 [StorableClass] 33 33 [Item("Variable", "Represents a variable value.")] -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs
r3294 r3373 27 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Random; 29 namespace HeuristicLab.Problems.DataAnalysis. Regression.Symbolic.Symbols {29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 30 30 [StorableClass] 31 31 public sealed class VariableTreeNode : SymbolicExpressionTreeTerminalNode {
Note: See TracChangeset
for help on using the changeset viewer.