-
Notifications
You must be signed in to change notification settings - Fork 0
/
Truck.h
150 lines (81 loc) · 2.13 KB
/
Truck.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#pragma once
#include "PriorityQueue.h"
#include "Cargo.h"
#include <iostream>
using namespace std;
class Company;
class Truck {
int Type; //(0) Normal (1) Special (2) VIP
int TruckCapacity, MaintenanceTime, Speed, Journies, DeliveryInterval;
int IDTruck;
int J_Count;
int CargoType;
int status; // (1) available (2) Loading (3) Maintenance
int DepartureHour;
int DepartureDay;
int ArrivalDay;
int ArrivalHour;
int CargoCount;
int CheckTime;
PriorityQueue<Cargo*>* Cargos;
Company* pC;
int Distance;
int LoadTime;
int FurthestDist;
int TotalDeliveredCargos;
int TotalJournies;
int TotalTruckActiveTime;
int StartDay, StartHour;
int LoadDay, LoadHour;
bool arrivaled;
public:
~Truck();
Truck(int t, int s, int capacity, int j, int time,int id=0);
void SetStatus(int S);
int GetTotalJournies() const;
double GetActiveTime() const;
int GetStatus() const;
void SetType(int a);
int Gettype()const;
bool HasReturned(int d, int h);
void SetStartTime(int d, int h);
void SetACCTforCargos();
void SetTruckCapacity(int x);
int GetTruckCapacity()const;
void SetMaintainceTime(int x);
int GetMaintainceTime()const;
void SetSpeed(int x);
void IncrementDeliveredCargos();
int GetCountDeliveredCargos();
int GetSpeed()const;
void DICalculation();
int GetDI() const;
int GetFurthestTime() const;
int GetIDTruck() const;
void SetJournies(int j);
int GetJournies() const;
bool Assign(Cargo* C);
int GetCargoType() const;
bool ModifyCargoType(int t);
bool DeliverCargoList(int d,int h);
int GetCargoTime() const;
void SetMoveTime(int moved, int moveh);
PriorityQueue<Cargo*>& GetCargoQueue();
void SetDepHour(int h);
void SetDepDay(int d);
void SetArrivalTime(int d, int h);
bool TruckisEmpty();
bool isFull();
void SetCargoType(int t);
void IncrementJournies();
bool GetCheckUp();
void SetCurrentJournies(int J);
void IncrementCheckTime();
void SetCheckTime(int t);
bool DoneMaintenance();
void setloadtime(int d, int h);
void setarrived(bool f);
bool getarrived();
float GetTruckUtil(int d, int h);
friend ostream& operator << (ostream& out, Truck* c);
};