summaryrefslogtreecommitdiffstats
path: root/labb3/tsp/src/Tour.h
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-09-21 15:44:37 +0200
committerGustav Sörnäs <gustav@sornas.net>2020-09-21 15:44:37 +0200
commit8b6a241faee1e0d9aac9281be7be883ba0332ac1 (patch)
tree9c6d51cafa4603da39d763b1b7509c2c89997517 /labb3/tsp/src/Tour.h
parente483926bf15d6a560885c9b26d1c51a796583745 (diff)
downloadtddd86-8b6a241faee1e0d9aac9281be7be883ba0332ac1.tar.gz
Initial solution L3
Diffstat (limited to 'labb3/tsp/src/Tour.h')
-rw-r--r--labb3/tsp/src/Tour.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/labb3/tsp/src/Tour.h b/labb3/tsp/src/Tour.h
index 5262792..bb5166b 100644
--- a/labb3/tsp/src/Tour.h
+++ b/labb3/tsp/src/Tour.h
@@ -1,9 +1,9 @@
-// This is the .h file you will edit and turn in.
-// We have provided a skeleton for you,
-// but you must finish it as described in the spec.
-// Also remove these comments here and add your own, as well as on the members.
-// TODO: remove this comment header
-
+/*
+ * TDDD86 Lab 3b - gusso230 (group 11)
+ * This file contains the tour structure.
+ * You can insert points using two algorithms (nearest neighbour and smallest
+ * increase), get the total length of the tour and draw the tour.
+ */
#ifndef TOUR_H
#define TOUR_H
@@ -12,18 +12,17 @@
class Tour {
public:
-
- Tour();
- ~Tour();
- void show();
- void draw(QGraphicsScene* scene);
- int size();
- double distance();
- void insertNearest(Point p);
- void insertSmallest(Point p);
+ 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 insertSmallest
private:
-
+ Node *first; // first node
};
#endif // TOUR_H