diff options
Diffstat (limited to 'labb3/tsp')
| -rw-r--r-- | labb3/tsp/src/Tour.h | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/labb3/tsp/src/Tour.h b/labb3/tsp/src/Tour.h index 7b47240..2a644b7 100644 --- a/labb3/tsp/src/Tour.h +++ b/labb3/tsp/src/Tour.h @@ -12,14 +12,45 @@ class Tour { public: - Tour(); // create an empty tour - ~Tour(); // free all nodes - void show() const; // print the tour to stdout - void draw(QGraphicsScene *scene) const; // draw the tour on `scene` - int size() const; // return number of points on tour - double distance() const; // return total distance of tour - void insertNearest(Point p); // insert `p` using nearestNeighbour - void insertSmallest(Point p); // insert `p` using smallestIncrease + /* + * Create an empty tour. + */ + Tour(); + + /* + * Free all nodes in the tour. + */ + ~Tour(); + + /* + * Print the tour to stdout. + */ + void show() const; + + /* + * Draw the tour to `scene`. + */ + void draw(QGraphicsScene *scene) const; + + /* + * Return the number of nodes in tour. + */ + int size() const; + + /* + * Return the total distance of the tour. + */ + double distance() const; + + /* + * Insert `p` using the "nearest neighbour" heuristic. + */ + void insertNearest(Point p); + + /* + * Insert `p` using the "smallest increase" heuristic. + */ + void insertSmallest(Point p); private: Node *first; // first node |
