Changeset 344 for trunk/sources/HeuristicLab.Functions
- Timestamp:
- 06/26/08 14:59:06 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.Functions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs
r324 r344 286 286 if(f.data.Count > 0) { 287 287 XmlAttribute dataAttribute = document.CreateAttribute("Data"); 288 dataAttribute.Value = GetString <double>(f.data);288 dataAttribute.Value = GetString(f.data); 289 289 entryNode.Attributes.Append(dataAttribute); 290 290 } … … 311 311 } 312 312 313 private string GetString <T>(IEnumerable<T> xs) where T : IConvertible{313 private string GetString(IEnumerable<double> xs) { 314 314 StringBuilder builder = new StringBuilder(); 315 foreach( Tx in xs) {316 builder.Append(x.ToString( CultureInfo.InvariantCulture) + "; ");315 foreach(double x in xs) { 316 builder.Append(x.ToString("r", CultureInfo.InvariantCulture) + "; "); 317 317 } 318 318 if(builder.Length > 0) builder.Remove(builder.Length - 2, 2); -
trunk/sources/HeuristicLab.Functions/ModelAnalyzerExporter.cs
r310 r344 54 54 public void Visit(Constant constant) { 55 55 double value = ((ConstrainedDoubleData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Constant.VALUE).Value).Data; 56 prefix += currentIndend + "[T]Constant(" + value + ";0;0)";56 prefix += currentIndend + "[T]Constant(" + value.ToString("r") + ";0;0)"; 57 57 } 58 58 … … 106 106 double offset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Variable.OFFSET).Value).Data; 107 107 108 prefix += currentIndend + "[T]Variable(" + weight + ";" + index + ";" + -offset + ")";108 prefix += currentIndend + "[T]Variable(" + weight.ToString("r") + ";" + index + ";" + -offset + ")"; 109 109 } 110 110
Note: See TracChangeset
for help on using the changeset viewer.