-
Notifications
You must be signed in to change notification settings - Fork 0
/
job.h
57 lines (53 loc) · 1.49 KB
/
job.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef JOB_H
#define JOB_H
#include <vector>
#include <QRandomGenerator>
struct OccupancyPair
{
int time;
float occupancy;
};
class Job
{
private:
bool _done = false;
int _critical_time = -1;
int* _following_time_to_spend = nullptr;
std::vector<Job*> ancestors;
int predecessors_count = 0;
int begin_min = 0;
int end_max = 0;
int want_renewable;
int want_non_renewable;
int time_to_spend;
int global_id = 0;
std::vector<OccupancyPair> occupancy;
int preference_coefficient = 0;
public:
Job(int renewable, int non_renewable, std::vector<OccupancyPair> occupancy);
int get_time_to_spend() const;
int get_want_renewable() const;
int get_want_non_renewable() const;
bool is_done() const;
void done();
void undone();
bool check_predecessors();
void set_ancestors(std::vector<Job*> new_ancestors);
std::vector<Job*>* get_ancestors();
void increment_predecessors_count();
void decrement_predecessors_count();
int get_critical_time() const;
bool critical_time_exists() const;
void set_critical_time(int time);
void reset_critical_time();
void set_start_after(int time);
int get_start_after() const;
void set_end_before(int time);
int get_end_before() const;
void set_global_id(int id);
int get_global_id();
std::vector<OccupancyPair> get_occupancy() const;
int get_preference_coefficient() const;
void set_preference_coefficient(int coefficient);
};
#endif // JOB_H