-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
49 lines (34 loc) · 1.21 KB
/
main.cpp
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
#include <iostream>
#include <fstream>
#include <cstring>
#include "include/cli.h"
#include "include/mainAlgorithm.h"
#include "include/MeasureTime.h"
int main(int argc, char* argv[]) {
// std::cout << "Argv_1: " << argv[1] << std::endl;
// std::cout << "Argv_2: " << argv[2] << std::endl;
UserInterface * cli = new UserInterface(argc, argv);
MeasureTime * mt = new MeasureTime();
int nWorkers, mCap, tCook;
char distrType;
int * comingTimestamps;
auto mode = cli->getMode();
mt->startClock();
Solver * solver = new Solver(
cli->getWorkers(),
cli->getCapacity(),
cli->getUnitTimeCooking(),
cli->getComingTimetamps()
);
solver->optimize();
cli->setFeedingTimestamps(solver->getFeedingTimestamps());
cli->setTotalTimeWait(solver->getTotalWaitingTime());
mt->stopClock();
cli->printTotalTimeWait();
cli->printFeedingTimestamps();
if (mode == UserInterface::TIME_TEST) {
std::cout << mt->getTimeMilli() << " ms" << std::endl;
std::cout << mt->getTimeMicro() << " us" << std::endl;
std::cout << mt->getTimeNano() << " ns" << std::endl;
}
}