-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDistanceFileHandler.h
More file actions
42 lines (34 loc) · 942 Bytes
/
DistanceFileHandler.h
File metadata and controls
42 lines (34 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* File: DistanceFileHandler.h
* Author: btacklind
*
* Created on May 21, 2015, 7:42 PM
*
* Reads a distance file and creates a Object that contains data from that
* file
*/
#ifndef DISTANCEFILEHANDLER_H
#define DISTANCEFILEHANDLER_H
#include "Tour.h"
#include <list>
#include <string>
using namespace std;
class DistanceFileHandler {
public:
DistanceFileHandler(const char* input);
DistanceFileHandler(const DistanceFileHandler& orig);
virtual ~DistanceFileHandler();
Tour NearestNeighbor();
Tour FarthestInsertion();
Tour SimpleTour();
private:
double getInnerDistancePntwise(int i, int j, int c);
double getInnerDistance(int a, int b, int d);
list<string> parseString(string line);
bool inTour(int i, int* tr);
bool inTour(int i, list<int> &tr);
void printList(list<int> l);
DistanceMatrix* distMatrix;
int points;
};
#endif /* DISTANCEFILEHANDLER_H */