Free cookie consent management tool by TermsFeed Policy Generator

Changeset 139 for branches/3.0/sources


Ignore:
Timestamp:
04/20/08 10:59:02 (17 years ago)
Author:
gkronber
Message:

merged serialization bug-fix (r138) from trunk into the 3.0 branch

Location:
branches/3.0/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/sources/HeuristicLab.Constraints/DoubleBoundedConstraint.cs

    r2 r139  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using System.Globalization;
    2829
    2930namespace HeuristicLab.Constraints {
     
    135136      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    136137      XmlAttribute lb = document.CreateAttribute("LowerBound");
    137       lb.Value = LowerBound+"";
     138      lb.Value = LowerBound.ToString(CultureInfo.InvariantCulture);
    138139      XmlAttribute lbi = document.CreateAttribute("LowerBoundIncluded");
    139       lbi.Value = lowerBoundIncluded+"";
     140      lbi.Value = lowerBoundIncluded.ToString();
    140141      XmlAttribute lbe = document.CreateAttribute("LowerBoundEnabled");
    141       lbe.Value = lowerBoundEnabled + "";
     142      lbe.Value = lowerBoundEnabled.ToString();
    142143      XmlAttribute ub = document.CreateAttribute("UpperBound");
    143       ub.Value = upperBound + "";
     144      ub.Value = upperBound.ToString(CultureInfo.InvariantCulture);
    144145      XmlAttribute ubi = document.CreateAttribute("UpperBoundIncluded");
    145       ubi.Value = upperBoundIncluded + "";
     146      ubi.Value = upperBoundIncluded.ToString();
    146147      XmlAttribute ube = document.CreateAttribute("UpperBoundEnabled");
    147       ube.Value = upperBoundEnabled + "";
     148      ube.Value = upperBoundEnabled.ToString();
    148149      node.Attributes.Append(lb);
    149150      if (!lowerBoundIncluded) node.Attributes.Append(lbi);
     
    157158    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    158159      base.Populate(node, restoredObjects);
    159       lowerBound = double.Parse(node.Attributes["LowerBound"].Value);
     160      lowerBound = double.Parse(node.Attributes["LowerBound"].Value, CultureInfo.InvariantCulture);
    160161      if (node.Attributes["LowerBoundIncluded"] != null) {
    161162        lowerBoundIncluded = bool.Parse(node.Attributes["LowerBoundIncluded"].Value);
     
    169170      }
    170171
    171       upperBound = double.Parse(node.Attributes["UpperBound"].Value);
     172      upperBound = double.Parse(node.Attributes["UpperBound"].Value, CultureInfo.InvariantCulture);
    172173      if (node.Attributes["UpperBoundIncluded"] != null) {
    173174        upperBoundIncluded = bool.Parse(node.Attributes["UpperBoundIncluded"].Value);
  • branches/3.0/sources/HeuristicLab.Random/NormalDistributedRandom.cs

    r2 r139  
    2525using HeuristicLab.Core;
    2626using System.Xml;
     27using System.Globalization;
    2728
    2829namespace HeuristicLab.Random {
     
    510511    #endregion
    511512
    512     #region IStorable Members
    513 
    514 
     513    #region persistence
    515514    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    516515      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    517516
    518517      XmlNode muNode = document.CreateNode(XmlNodeType.Element, "Mu", null);
    519       muNode.InnerText = mu.ToString();
     518      muNode.InnerText = mu.ToString(CultureInfo.InvariantCulture);
    520519      node.AppendChild(muNode);
    521520
    522521      XmlNode sigmaNode = document.CreateNode(XmlNodeType.Element, "Sigma", null);
    523       sigmaNode.InnerText = sigma.ToString();
     522      sigmaNode.InnerText = sigma.ToString(CultureInfo.InvariantCulture);
    524523      node.AppendChild(sigmaNode);
    525524
     
    532531      base.Populate(node, restoredObjects);
    533532
    534       mu = double.Parse(node.SelectSingleNode("Mu").InnerText);
    535       sigma = double.Parse(node.SelectSingleNode("Sigma").InnerText);
     533      mu = double.Parse(node.SelectSingleNode("Mu").InnerText, CultureInfo.InvariantCulture);
     534      sigma = double.Parse(node.SelectSingleNode("Sigma").InnerText, CultureInfo.InvariantCulture);
    536535      uniform = (IRandom)PersistenceManager.Restore(node.SelectSingleNode("UniformRandom"), restoredObjects);
    537536    }
Note: See TracChangeset for help on using the changeset viewer.