-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoertuig.h
208 lines (152 loc) · 5.86 KB
/
voertuig.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
// Prototype van classe Voertuig
// Marceli Wilczynski && Tomas Ghysels
// 18.03.2022
// version 1.0
#ifndef OEFENINGXML_VOERTUIGEN_H
#define OEFENINGXML_VOERTUIGEN_H
#include "verkeerslicht.h"
#include "baan.h"
using namespace std;
class Voertuig{
protected:
Voertuig* _initCheck;
Baan* fBaan;
double fPositie;
double fSnelheid;
int fLengte;
double fAbs_max_snelheid;
double fMax_snelheid;
double fVersnelling;
double fMax_versnelling;
double fMax_remfactor;
int fMin_volgafstand;
int fVertraagafstand;
int fStopafstand;
double fVertraagfactor;
int fIndexVoertuig;
double fVolgafstand;
double fSnelheidsverschil;
double fDelta;
string type;
string afkortingType;
public:
/**
\n ENSURE(this->properlyInitialized(), "De voertuigconstructor is slecht geinitialiseerd");
*/
Voertuig();
bool properlyInitialized();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
Baan *getBaan();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
double getPositie();
/**
\n ENSURE((fPositie >= 0), "Positie is kleiner dan 0");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void setBaan(Baan *baan);
/**
\n ENSURE(baan->properlyInitialized(), "De constructor is slecht geinitialiseerd");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
\n REQUIRE((positie >= 0), "Positie is kleiner dan 0");
*/
void setPositie(int positie);
/**
\n ENSURE((positie >= 0), "Positie is kleiner dan 0");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
\n REQUIRE((fSnelheid >= 0), "Positie is kleiner dan 0");
*/
double getSnelheid();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
\n REQUIRE((fAbs_max_snelheid == 16.6), "De absolute max snelheid != 16.6");
*/
double getAbs_max_snelheid();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
\n REQUIRE((fSnelheid >= 0), "De snelheid van jouw Voertuig is < 0");
*/
void change_positie();
/**
\n ENSURE((fPositie >= 0 && fPositie <= this->getBaan()->getLengte()),"Positite van jouw voertuig is buiten de baan");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void change_versnelling(vector<Voertuig*> &vectVoertuigen);
/**
\n ENSURE((index >= 0), "De index van jouw voertuig is kleiner dan 0");
\n ENSURE((fVolgafstand >= 0), "Volgafstand tussen jouw 2 voertuigen is niet correct");
\n ENSURE((fSnelheidsverschil >= 0), "De snelheidsverschil van jouw voertuig is kleiner dan 0");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
int getFindexVoertuig();
/**
\n ENSURE((fIndexVoertuig > 0), "Index van jouw voertuig is niet in de baan");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void setFindexVoertuig(int findexVoertuig);
/**
\n ENSURE((fIndexVoertuig >= 0), "Jouw index van jouw voertuig is niet correct");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
int getFLengte();
/**
\n ENSURE(fLengte >= 0, "De lengte van jouw voertuig is niet correct");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
int getFMinVolgafstand();
/**
\n ENSURE(fMin_volgafstand == 4, "De minimale volgafstand is niet correct");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
bool checkInBaan(Baan& b1, vector<Voertuig*> vectVoertuigen);
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void verwijderUitBaan(Baan& b1, vector<Voertuig*> vectVoertuigen);
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void vertragen();
/**
\n ENSURE(fMax_snelheid >= 0, "De Max_snelheid van jouw voertuig is niet correct");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void versnellen();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void stoppen();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
\n REQUIRE(fMax_remfactor == 4.61,"Max Remfactor is niet correct");
*/
double getFMaxRemfactor();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
const string &getType();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void setType(const string &type2);
/**
\n ENSURE(type2 != "","string mag niet leeg zijn");
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void changeTypeVoertuig();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
const string &getAfkortingType();
/**
\n REQUIRE(this->properlyInitialized(), "De constructor is slecht geinitialiseerd");
*/
void setAfkortingType(const string &afkortingType);
/**
\n ENSURE(afkortingType != "", "Een voertuig moet een afkorting hebben");
*/
};
#endif //OEFENINGXML_VOERTUIGEN_H