Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4869 for branches


Ignore:
Timestamp:
11/20/10 02:15:09 (14 years ago)
Author:
swinkler
Message:

Fixed bugs in Smalltalk formatter. (#1270)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Formatters/SymbolicExpressionTreeSmalltalkStringFormatter.cs

    r4868 r4869  
    5959        for (int i = 0; i < node.SubTrees.Count; i++) {
    6060          if (i > 0) stringBuilder.Append("+");
    61           stringBuilder.Append("(");
    6261          stringBuilder.Append(FormatRecursively(node.SubTrees[i]));
    63           stringBuilder.Append(")");
    6462        }
    6563      } else if (symbol is And) {
     
    8583      } else if (symbol is Constant) {
    8684        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
    87         stringBuilder.Append(constantTreeNode.Value);
     85        stringBuilder.Append(constantTreeNode.Value.ToString().Replace(",", "."));
    8886      } else if (symbol is Cosine) {
    8987        stringBuilder.Append(FormatRecursively(node.SubTrees[0]));
     
    118116        stringBuilder.Append("] ifFalse: [");
    119117        stringBuilder.Append(FormatRecursively(node.SubTrees[2]));
    120         stringBuilder.Append("] )");
     118        stringBuilder.Append("]");
    121119      } else if (symbol is LaggedVariable) {
    122120        stringBuilder.Append("not implemented");
     
    136134        }
    137135      } else if (symbol is Not) {
    138         stringBuilder.Append("-");
     136        stringBuilder.Append("-1*");
    139137        stringBuilder.Append(FormatRecursively(node.SubTrees[0]));
    140138      } else if (symbol is Or) {
     
    152150      } else if (symbol is Subtraction) {
    153151        if (node.SubTrees.Count == 1) {
    154           stringBuilder.Append("-");
     152          stringBuilder.Append("-1*");
    155153          stringBuilder.Append(FormatRecursively(node.SubTrees[0]));
    156154        } else {
     
    166164      } else if (symbol is HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable) {
    167165        VariableTreeNode variableTreeNode = node as VariableTreeNode;
    168         stringBuilder.Append(variableTreeNode.Weight);
     166        stringBuilder.Append(variableTreeNode.Weight.ToString().Replace(",", "."));
    169167        stringBuilder.Append("*");
    170168        stringBuilder.Append(variableTreeNode.VariableName);
Note: See TracChangeset for help on using the changeset viewer.