Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/09/09 14:11:38 (15 years ago)
Author:
gkronber
Message:

Made symbolic expression export of GP trees culture invariant. #778

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs

    r2264 r2423  
    2424using System;
    2525using System.Collections.Generic;
     26using System.Globalization;
    2627
    2728namespace HeuristicLab.GP.StructureIdentification {
     
    118119
    119120    public static string ExportToScheme(this Constant constant, IFunctionTree tree) {
    120       return ((ConstantFunctionTree)tree).Value.ToString("r");
     121      return ((ConstantFunctionTree)tree).Value.ToString("r", CultureInfo.InvariantCulture.NumberFormat);
    121122    }
    122123
     
    167168    public static string ExportToScheme(this Variable variable, IFunctionTree tree) {
    168169      var varTree = (VariableFunctionTree)tree;
    169       return "variable " + varTree.Weight.ToString("r") + " " +
     170      return "variable " + varTree.Weight.ToString("r", CultureInfo.InvariantCulture.NumberFormat) + " " +
    170171        varTree.VariableName + " " + varTree.SampleOffset;
    171172    }
    172173    public static string ExportToScheme(this Differential differential, IFunctionTree tree) {
    173174      var varTree = (VariableFunctionTree)tree;
    174       return "differential " + varTree.Weight.ToString("r") + " " +
     175      return "differential " + varTree.Weight.ToString("r", CultureInfo.InvariantCulture.NumberFormat) + " " +
    175176        varTree.VariableName + " " + varTree.SampleOffset;
    176177    }
Note: See TracChangeset for help on using the changeset viewer.