-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathState.h
44 lines (30 loc) · 803 Bytes
/
State.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
41
42
43
44
//
// Created by root on 31/8/16.
//
#ifndef COL333ASSIGNMENT1_STATE_H
#define COL333ASSIGNMENT1_STATE_H
#include <vector>
#include "node.h"
class State {
private:
std::vector<int> bidNumbers;
double cost;
int numConflicts;
public:
State(std::vector<int> bidNumbers, double cost, int numConflicts);
std::vector<int> getBidNumbers();
void setBidNumbers(std::vector<int> bidNumbers);
int getConflicts() const;
void setConflicts(int numConflicts);
double getCost() const;
double getFitness() const;
bool isValid();
bool operator==(const State &state) const;
};
class CompareState {
public:
bool operator()(State state1, State state2) {
return (state1.getFitness() < state2.getFitness());
}
};
#endif //COL333ASSIGNMENT1_STATE_H