-
Notifications
You must be signed in to change notification settings - Fork 1
/
Solution.h
40 lines (34 loc) · 916 Bytes
/
Solution.h
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
#pragma once
/*
* Solution.h
* TravellingSalesman
*
* Created by Mikulas Dite on 11/10/10.
* Copyright 2010 GChD. All rights reserved.
*
*/
#include <iostream>
#include <string.h>
#include <math.h>
#include <vector.h>
#include "Map.h"
#include "City.h"
#include "config.h"
using namespace std;
class Solution
{
private:
CITY path[CITIES];
double getDistance(CITY, CITY) const;
public:
Solution();
Solution(Map);
Solution(Solution, Solution);
Solution(CITY[CITIES]);
double getFitness() const;
void print();
bool operator< (const Solution &s2) const {return (this->getFitness() < s2.getFitness()); };
bool operator<= (const Solution &s2) const {return (this->getFitness() <= s2.getFitness()); };
bool operator> (const Solution &s2) const {return (this->getFitness() > s2.getFitness()); };
bool operator>= (const Solution &s2) const {return (this->getFitness() >= s2.getFitness()); };
};