- Timestamp:
- 01/18/10 09:28:53 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification.Networks/3.2/NetworkToFunctionTransformer.cs
r2631 r2633 58 58 exprScope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("FunctionTree"), new GeneticProgrammingModel(transformedTree))); 59 59 exprScope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TargetVariable"), new StringData(targetVariableEnumerator.Current))); 60 Debug.Assert(!(transformedTree is VariableFunctionTree) || ((VariableFunctionTree)transformedTree).VariableName != targetVariableEnumerator.Current); 60 61 } 61 62 … … 214 215 /// <returns></returns> 215 216 private static IFunctionTree TransformExpression(IFunctionTree tree, string targetVariable, IEnumerable<string> parameters) { 216 if (tree.Function is Variable || tree.Function is Constant || tree.Function is Differential) return tree; 217 if (tree.Function is Constant) return tree; 218 if (tree.Function is Variable || tree.Function is Differential) { 219 VariableFunctionTree varTree = (VariableFunctionTree)tree; 220 varTree.Weight = 1.0; 221 if (varTree.VariableName == targetVariable) varTree.VariableName = parameters.First(); 222 return varTree; 223 } 217 224 if (tree.Function is Addition || tree.Function is Subtraction || 218 225 tree.Function is Multiplication || tree.Function is Division ||
Note: See TracChangeset
for help on using the changeset viewer.