diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-09-22 11:15:23 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-09-22 11:15:23 +0200 |
| commit | c7c7cf71500ffaef9b42abc5c2980889b08a6220 (patch) | |
| tree | 2a12d85f031f22cbd356fc277c80bcdbf90161cb /labb3/tsp/src/Tour.h | |
| parent | bd04af6c3509b8b4fe02c30c5c0487aea491a8a9 (diff) | |
| download | tddd86-c7c7cf71500ffaef9b42abc5c2980889b08a6220.tar.gz | |
Comments
Diffstat (limited to 'labb3/tsp/src/Tour.h')
| -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 |
