Changeset 884 for trunk/sources/HeuristicLab.Routing.TSP/TSPTour.cs
- Timestamp:
- 12/02/08 12:41:21 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Routing.TSP/TSPTour.cs
r2 r884 29 29 30 30 namespace HeuristicLab.Routing.TSP { 31 /// <summary> 32 /// Represent the tour of a TSP. 33 /// </summary> 31 34 public class TSPTour : ItemBase, IVisualizationItem { 32 35 private DoubleMatrixData myCoordinates; 36 /// <summary> 37 /// Gets or sets the coordinates of the current instance. 38 /// </summary> 33 39 public DoubleMatrixData Coordinates { 34 40 get { return myCoordinates; } … … 36 42 } 37 43 private Permutation.Permutation myTour; 44 /// <summary> 45 /// Gets or sets the current permutation/tour of the current instance. 46 /// </summary> 38 47 public Permutation.Permutation Tour { 39 48 get { return myTour; } … … 42 51 43 52 53 /// <summary> 54 /// Initializes a new instance of <see cref="TSPTour"/>. 55 /// </summary> 44 56 public TSPTour() { } 57 /// <summary> 58 /// Initializes a new instance of <see cref="TSPTour"/> with the given <paramref name="coordinates"/> 59 /// and the given <paramref name="tour"/>. 60 /// </summary> 61 /// <param name="coordinates">The coordinates of the TSP.</param> 62 /// <param name="tour">The tour the current instance should represent.</param> 45 63 public TSPTour(DoubleMatrixData coordinates, Permutation.Permutation tour) { 46 64 myCoordinates = coordinates; … … 48 66 } 49 67 50 68 /// <summary> 69 /// Clones the current instance (deep clone). 70 /// </summary> 71 /// <remarks>Uses <see cref="Auxiliary.Clone"/> method of class <see cref="Auxiliary"/> to clone 72 /// the coordinates.</remarks> 73 /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param> 74 /// <returns>The cloned object as <see cref="TSPTour"/>.</returns> 51 75 public override object Clone(IDictionary<Guid, object> clonedObjects) { 52 76 TSPTour clone = (TSPTour)base.Clone(clonedObjects); … … 56 80 } 57 81 82 /// <summary> 83 /// Creates a new instance of <see cref="TSPTourView"/> to display the current instance. 84 /// </summary> 85 /// <returns>The created view as <see cref="TSPTourView"/>.</returns> 58 86 public override IView CreateView() { 59 87 return new TSPTourView(this); 60 88 } 61 89 90 /// <summary> 91 /// Occurs when the coordinates of the current instance have been changed. 92 /// </summary> 62 93 public event EventHandler CoordinatesChanged; 94 /// <summary> 95 /// Fires a new <c>CoordinatesChanged</c> event. 96 /// </summary> 63 97 protected virtual void OnCoordinatesChanged() { 64 98 if (CoordinatesChanged != null) 65 99 CoordinatesChanged(this, new EventArgs()); 66 100 } 101 /// <summary> 102 /// Occurs when the tour of the current instance has been changed. 103 /// </summary> 67 104 public event EventHandler TourChanged; 105 /// <summary> 106 /// Fires a new <c>TourChanged</c> event. 107 /// </summary> 68 108 protected virtual void OnTourChanged() { 69 109 if (TourChanged != null) … … 72 112 73 113 #region Persistence Methods 114 /// <summary> 115 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 116 /// </summary> 117 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>. <br/> 118 /// The coordinates and the tour are saved as a child node with the tag names <c>Coordinates</c> and 119 /// <c>Tour</c>.</remarks> 120 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 121 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 122 /// <param name="persistedObjects">The dictionary of all already persisted objects. 123 /// (Needed to avoid cycles.)</param> 124 /// <returns>The saved <see cref="XmlNode"/>.</returns> 74 125 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 75 126 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 78 129 return node; 79 130 } 131 /// <summary> 132 /// Loads the persisted TSP tour from the specified <paramref name="node"/>. 133 /// </summary> 134 /// <remarks>Calls <see cref="StorableBase.Populate"/> of base class 135 /// <see cref="ItemBase"/>.<br/> 136 /// The coordinates and the tour must be saved as child nodes with the tag names <c>Coordinates</c> 137 /// and <c>Tour</c> (see <see cref="GetXmlNode"/>).</remarks> 138 /// <param name="node">The <see cref="XmlNode"/> where the TSP tour is saved.</param> 139 /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid cycles.)</param> 80 140 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 81 141 base.Populate(node, restoredObjects);
Note: See TracChangeset
for help on using the changeset viewer.