Changeset 11021 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs
- Timestamp:
- 06/16/14 15:37:23 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs
r10936 r11021 24 24 using System.Drawing; 25 25 using System.Linq; 26 using System.Text; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; … … 178 179 get { return Common.Resources.VSImageLibrary.Graph; } 179 180 } 181 182 public string ExportDot() { 183 var sb = new StringBuilder(); 184 sb.Append("digraph g {"); 185 foreach (var v in Vertices) { 186 sb.Append("\"" + v.Id + "\" [label=\"" + v.Label + "\"];" + Environment.NewLine); 187 } 188 189 foreach (var v in Vertices) { 190 foreach (var c in v.OutArcs.Select(x => x.Target)) { 191 sb.Append("\"" + v.Id + "\" -> \"" + c.Id + "\"" + Environment.NewLine); 192 } 193 } 194 sb.Append("}"); 195 return sb.ToString(); 196 } 180 197 } 181 198 }
Note: See TracChangeset
for help on using the changeset viewer.