-
Notifications
You must be signed in to change notification settings - Fork 0
/
casualty.h
122 lines (101 loc) · 3.24 KB
/
casualty.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef VICTIM_H
#define VICTIM_H
#include <iostream>
#include <vector>
class Casualty
{
public:
Casualty();
~Casualty();
// setters
void setCasualtyID(int id);
void setCasualtyGravity(int g);
void setCasualtyAge(int a);
void setCasualtyLocation(int node_id);
void setCasualtyPriority(float lambda);
void setCasualtyAppearTime(float time);
void setCasualtyAssignedHospital(int h);
void setCasualtyAssignedVehicle(int m);
void setCasualtyAssignedVehicleType(int e);
void setCasualtyWaitTime(float t);
void setCasualtyTimeToHeliport(float d);
void setCasualtyVehArrivedTime(float t);
void setCasualtyStabilizedTime(float t);
void setCasualtyAdmittedAtHospitalTime(float t);
void setCasualtyRound(int r);
void addGravityChangeTimestamp(float t, int inroute_flag);
// getters
int getCasualtyRound();
int getCasualtyID();
int getCasualtyGravity();
int getCasualtyAge();
int getCasualtyLocation();
float getCasualtyPriority();
int getCasualtyAssignedHospital();
int getCasualtyAssignedVehicle();
int getCasualtyAssignedVehicleType();
float getCasualtyAppearTime();
float getCasualtyWaitTime();
float getCasualtyTimeToHeliport();
float getLastGravityChange();
float getCasualtyVehArrivedTime();
float getCasualtyStabilizedTime();
float getCasualtyAdmittedAtHospitalTime();
void printData();
// period-change specific methods
void resetGravityChange(int current_time);
// metaheuristic-specific methods
void snapshotLastAssinment(int current_time);
void resetLastAssignment();
void saveLastAssignment();
private:
// Static values
int cas_id_k;
int cas_age_a;
int cas_curlocation;
float cas_appear_time;
float cas_time_to_heliport;
// Changing values (assignment-specific)
int round = 0;
float cas_priority_lambda;
int prev_prev_g_inroute_flag = 0;
int prev_g_inroute_flag = 0;
int g_inroute_flag = 0;
// id of assigned vehicle
int cas_assigned_veh = -1;
int cas_prev_veh = -1;
int cas_prev_prev_veh = -1;
// type of vehicle assigned
int cas_assigned_veh_type = -1;
int cas_prev_veh_type = -1;
int cas_prev_prev_veh_type = -1;
// assigned hospital
int cas_assigned_hosp = -1;
int cas_prev_hosp = -1;
int cas_prev_prev_hosp = -1;
// victim has to wait until X to vehicle to be assigned to it
float cas_wait_time = -1;
float cas_prev_wait_time = -1;
float cas_prev_prev_wait_time = -1;
// the vehicle arrives at victims location at X
float cas_arrival_time = -1;
float cas_prev_arrival_time = -1;
float cas_prev_prev_arrival_time = -1;
// victim is stabilized at X
float cas_st_time = -1;
float cas_prev_st_time = -1;
float cas_prev_prev_st_time = -1;
// victim is admitted to hospital at X
float cas_h_time = -1;
float cas_prev_h_time = -1;
float cas_prev_prev_h_time = -1;
// methauristic-specific
int yet_to_snapshot = 1;
// current gravity
std::vector<int> cas_curgravity_g;
std::vector<int> cas_prev_g;
// timestamp of last gravity change
std::vector<float> cas_g_change_timestamp;
std::vector<float> cas_prev_g_change_timestamp;
};
#endif