Changeset 18114 for branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations
- Timestamp:
- 12/13/21 10:25:35 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/TransformationToSymbolicTreeMapper.cs
r18112 r18114 84 84 // k * x 85 85 var multiplicationNode = new Multiplication().CreateTreeNode(); 86 var kNode = Create ConstantTreeNode("k", kValue);86 var kNode = CreateNumber("k", kValue); 87 87 var xNode = CreateVariableTreeNode(column, "x"); 88 88 multiplicationNode.AddSubtree(kNode); … … 91 91 // ( k * x ) + d 92 92 var additionNode = new Addition().CreateTreeNode(); 93 var dNode = Create ConstantTreeNode("d", dValue);93 var dNode = CreateNumber("d", dValue); 94 94 additionNode.AddSubtree(multiplicationNode); 95 95 additionNode.AddSubtree(dNode); … … 105 105 // x - d 106 106 var substractionNode = new Subtraction().CreateTreeNode(); 107 var dNode = Create ConstantTreeNode("d", dValue);107 var dNode = CreateNumber("d", dValue); 108 108 var xNode = CreateVariableTreeNode(column, "x"); 109 109 substractionNode.AddSubtree(xNode); … … 112 112 // ( x - d ) / k 113 113 var divisionNode = new Division().CreateTreeNode(); 114 var kNode = Create ConstantTreeNode("k", kValue);114 var kNode = CreateNumber("k", kValue); 115 115 divisionNode.AddSubtree(substractionNode); 116 116 divisionNode.AddSubtree(kNode); … … 157 157 var powerNode = new Power().CreateTreeNode(); 158 158 var xNode = CreateVariableTreeNode(column, "x"); 159 var expNode = Create ConstantTreeNode("exp", expValue);159 var expNode = CreateNumber("exp", expValue); 160 160 powerNode.AddSubtree(xNode); 161 161 powerNode.AddSubtree(expNode); … … 171 171 var rootNode = new Root().CreateTreeNode(); 172 172 var xNode = CreateVariableTreeNode(column, "x"); 173 var bNode = Create ConstantTreeNode("b", expValue);173 var bNode = CreateNumber("b", expValue); 174 174 rootNode.AddSubtree(xNode); 175 175 rootNode.AddSubtree(bNode); … … 220 220 // log(x, b) 221 221 var logNode = new Logarithm().CreateTreeNode(); 222 var bNode = Create ConstantTreeNode("b", b);222 var bNode = CreateNumber("b", b); 223 223 var xNode = CreateVariableTreeNode(column, "x"); 224 224 logNode.AddSubtree(xNode); … … 231 231 // b ^ x 232 232 var powerNode = new Power().CreateTreeNode(); 233 var bNode = Create ConstantTreeNode("b", b);233 var bNode = CreateNumber("b", b); 234 234 var xNode = CreateVariableTreeNode(column, "x"); 235 235 powerNode.AddSubtree(bNode); … … 242 242 // 1 / x 243 243 var divNode = new Division().CreateTreeNode(); 244 var oneNode = Create ConstantTreeNode("1", 1.0);244 var oneNode = CreateNumber("1", 1.0); 245 245 var xNode = CreateVariableTreeNode(column, "x"); 246 246 divNode.AddSubtree(oneNode); … … 254 254 var substractionNode = new Subtraction().CreateTreeNode(); 255 255 var xNode = CreateVariableTreeNode(variable, "x"); 256 var m_orgNode = Create ConstantTreeNode("m_org", m_org);256 var m_orgNode = CreateNumber("m_org", m_org); 257 257 substractionNode.AddSubtree(xNode); 258 258 substractionNode.AddSubtree(m_orgNode); … … 260 260 // (x - m_org) / s_org 261 261 var divisionNode = new Division().CreateTreeNode(); 262 var s_orgNode = Create ConstantTreeNode("s_org", s_org);262 var s_orgNode = CreateNumber("s_org", s_org); 263 263 divisionNode.AddSubtree(substractionNode); 264 264 divisionNode.AddSubtree(s_orgNode); … … 266 266 // ((x - m_org) / s_org ) * s_tar 267 267 var multiplicationNode = new Multiplication().CreateTreeNode(); 268 var s_tarNode = Create ConstantTreeNode("s_tar", s_tar);268 var s_tarNode = CreateNumber("s_tar", s_tar); 269 269 multiplicationNode.AddSubtree(divisionNode); 270 270 multiplicationNode.AddSubtree(s_tarNode); … … 272 272 // ((x - m_org) / s_org ) * s_tar + m_tar 273 273 var additionNode = new Addition().CreateTreeNode(); 274 var m_tarNode = Create ConstantTreeNode("m_tar", m_tar);274 var m_tarNode = CreateNumber("m_tar", m_tar); 275 275 additionNode.AddSubtree(multiplicationNode); 276 276 additionNode.AddSubtree(m_tarNode); … … 279 279 } 280 280 281 private NumberTreeNode Create ConstantTreeNode(string description, double value) {281 private NumberTreeNode CreateNumber(string description, double value) { 282 282 return new NumberTreeNode(new Number()) { Value = value }; 283 283 }
Note: See TracChangeset
for help on using the changeset viewer.