-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTour.hpp
More file actions
36 lines (32 loc) · 799 Bytes
/
Tour.hpp
File metadata and controls
36 lines (32 loc) · 799 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
//
// Created by danny on 2018-11-08.
//
#ifndef GENETICALGORITHM_TOUR_HPP
#define GENETICALGORITHM_TOUR_HPP
#include <vector>
#include <algorithm>
#include <math.h>
#include "City.hpp"
#include "RandomNumGenerator.hpp"
class Tour {
private:
constexpr static int CITIES_IN_TOUR = 32;
constexpr static int SHUFFLES = 64;
vector<City> cities;
double fitness;
int distance;
public:
explicit Tour(bool);
~Tour() = default;
City & getCity(int);
void shuffleCities();
void swapCities();
int getTourDistance();
double determineFitness();
bool containsCity(City);
vector<City> &getTour();
friend ostream &operator << (ostream&, Tour&);
bool operator == (Tour&);
bool operator<(const Tour&) const;
};
#endif //GENETICALGORITHM_TOUR_HPP