Changeset 139 for branches/3.0/sources
- Timestamp:
- 04/20/08 10:59:02 (17 years ago)
- Location:
- branches/3.0/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/sources/HeuristicLab.Constraints/DoubleBoundedConstraint.cs
r2 r139 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using System.Globalization; 28 29 29 30 namespace HeuristicLab.Constraints { … … 135 136 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 136 137 XmlAttribute lb = document.CreateAttribute("LowerBound"); 137 lb.Value = LowerBound +"";138 lb.Value = LowerBound.ToString(CultureInfo.InvariantCulture); 138 139 XmlAttribute lbi = document.CreateAttribute("LowerBoundIncluded"); 139 lbi.Value = lowerBoundIncluded +"";140 lbi.Value = lowerBoundIncluded.ToString(); 140 141 XmlAttribute lbe = document.CreateAttribute("LowerBoundEnabled"); 141 lbe.Value = lowerBoundEnabled + "";142 lbe.Value = lowerBoundEnabled.ToString(); 142 143 XmlAttribute ub = document.CreateAttribute("UpperBound"); 143 ub.Value = upperBound + "";144 ub.Value = upperBound.ToString(CultureInfo.InvariantCulture); 144 145 XmlAttribute ubi = document.CreateAttribute("UpperBoundIncluded"); 145 ubi.Value = upperBoundIncluded + "";146 ubi.Value = upperBoundIncluded.ToString(); 146 147 XmlAttribute ube = document.CreateAttribute("UpperBoundEnabled"); 147 ube.Value = upperBoundEnabled + "";148 ube.Value = upperBoundEnabled.ToString(); 148 149 node.Attributes.Append(lb); 149 150 if (!lowerBoundIncluded) node.Attributes.Append(lbi); … … 157 158 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 158 159 base.Populate(node, restoredObjects); 159 lowerBound = double.Parse(node.Attributes["LowerBound"].Value );160 lowerBound = double.Parse(node.Attributes["LowerBound"].Value, CultureInfo.InvariantCulture); 160 161 if (node.Attributes["LowerBoundIncluded"] != null) { 161 162 lowerBoundIncluded = bool.Parse(node.Attributes["LowerBoundIncluded"].Value); … … 169 170 } 170 171 171 upperBound = double.Parse(node.Attributes["UpperBound"].Value );172 upperBound = double.Parse(node.Attributes["UpperBound"].Value, CultureInfo.InvariantCulture); 172 173 if (node.Attributes["UpperBoundIncluded"] != null) { 173 174 upperBoundIncluded = bool.Parse(node.Attributes["UpperBoundIncluded"].Value); -
branches/3.0/sources/HeuristicLab.Random/NormalDistributedRandom.cs
r2 r139 25 25 using HeuristicLab.Core; 26 26 using System.Xml; 27 using System.Globalization; 27 28 28 29 namespace HeuristicLab.Random { … … 510 511 #endregion 511 512 512 #region IStorable Members 513 514 513 #region persistence 515 514 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 516 515 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 517 516 518 517 XmlNode muNode = document.CreateNode(XmlNodeType.Element, "Mu", null); 519 muNode.InnerText = mu.ToString( );518 muNode.InnerText = mu.ToString(CultureInfo.InvariantCulture); 520 519 node.AppendChild(muNode); 521 520 522 521 XmlNode sigmaNode = document.CreateNode(XmlNodeType.Element, "Sigma", null); 523 sigmaNode.InnerText = sigma.ToString( );522 sigmaNode.InnerText = sigma.ToString(CultureInfo.InvariantCulture); 524 523 node.AppendChild(sigmaNode); 525 524 … … 532 531 base.Populate(node, restoredObjects); 533 532 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); 536 535 uniform = (IRandom)PersistenceManager.Restore(node.SelectSingleNode("UniformRandom"), restoredObjects); 537 536 }
Note: See TracChangeset
for help on using the changeset viewer.