Self-test implementations.
256 {
257 for (int i{}; i < 1000; i++) {
258 srand(
time(
nullptr));
259 uint32_t n = 1 + rand() % 1000;
262
263 for (uint32_t i{}; i < n; i++) {
264 get<0>(input[i]) = i;
265 srand(
time(
nullptr));
266 get<1>(input[i]) = 1 + rand() % 10000;
267 srand(
time(
nullptr));
268 get<2>(input[i]) = 1 + rand() % 10000;
269 }
270
271 for (uint32_t i{}; i < n; i++) {
272 readyQueue.
addProcess(get<0>(input[i]), get<1>(input[i]),
273 get<2>(input[i]));
274 }
276 res = get_final_status<uint32_t, uint32_t, uint32_t>(input);
278
279 }
280 cout <<
"All the tests have successfully passed!" <<
endl;
281}
Class which implements the FCFS scheduling algorithm.
Definition fcfs_scheduling.cpp:97
void addProcess(S id, T arrival, E burst)
Adds the process to the ready queue if it isn't already there.
Definition fcfs_scheduling.cpp:129
vector< tuple< S, T, E, double, double, double > > scheduleForFcfs()
Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...
Definition fcfs_scheduling.cpp:154
#define endl
Definition matrix_exponentiation.cpp:36