Changeset 518
- Timestamp:
- 08/18/08 15:45:25 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/ModelAnalyzerExporter.cs
r365 r518 29 29 public class ModelAnalyzerExporter : IFunctionVisitor { 30 30 private string prefix; 31 private string currentInden d= "";31 private string currentIndent = ""; 32 32 private IFunctionTree currentBranch; 33 33 public string ModelAnalyzerPrefix { … … 39 39 40 40 private void VisitFunction(string name, IFunction f) { 41 prefix += currentInden d+ "[F]" + name + "(\n";41 prefix += currentIndent + "[F]" + name + "(\n"; 42 42 } 43 43 … … 54 54 public void Visit(Constant constant) { 55 55 double value = ((ConstrainedDoubleData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Constant.VALUE).Value).Data; 56 prefix += currentInden d+ "[T]Constant(" + value.ToString("r") + ";0;0)";56 prefix += currentIndent + "[T]Constant(" + value.ToString("r") + ";0;0)"; 57 57 } 58 58 … … 66 66 double offset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Differential.OFFSET).Value).Data; 67 67 68 prefix += currentInden d+ "[T]Differential(" + weight.ToString("r") + ";" + index + ";" + -offset + ")";68 prefix += currentIndent + "[T]Differential(" + weight.ToString("r") + ";" + index + ";" + -offset + ")"; 69 69 } 70 70 … … 114 114 double offset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Variable.OFFSET).Value).Data; 115 115 116 prefix += currentInden d+ "[T]Variable(" + weight.ToString("r") + ";" + index + ";" + -offset + ")";116 prefix += currentIndent + "[T]Variable(" + weight.ToString("r") + ";" + index + ";" + -offset + ")"; 117 117 } 118 118 … … 157 157 currentBranch = functionTree; 158 158 functionTree.Function.Accept(this); 159 currentInden d+= " ";159 currentIndent += " "; 160 160 foreach(IFunctionTree subTree in functionTree.SubTrees) { 161 161 Visit(subTree); … … 164 164 prefix = prefix.TrimEnd(';', '\n'); 165 165 if(functionTree.SubTrees.Count>0) prefix += ")"; 166 currentInden d = currentIndend.Remove(0, 2);166 currentIndent = currentIndent.Remove(0, 2); 167 167 } 168 168 }
Note: See TracChangeset
for help on using the changeset viewer.