-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschedwork-driver.cpp
More file actions
52 lines (48 loc) · 1.03 KB
/
schedwork-driver.cpp
File metadata and controls
52 lines (48 loc) · 1.03 KB
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
// main() program to test your schedule function.
// Feel free to modify this program in any way you need for testing.
// It will not be graded.
#include <set>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include "schedwork.h"
using namespace std;
void printSchedule(const DailySchedule& sched);
int main()
{
// Replace the matrix below with your test case
AvailabilityMatrix avail = {
{1, 1, 1, 1},
{1, 0, 1, 0},
{1, 1, 0, 1},
{1, 0, 0, 1}
};
DailySchedule sched;
bool solutionFound = schedule(avail, 2, 2, sched);
if(solutionFound)
{
printSchedule(sched);
}
else
{
cout << "No solution found!" << endl;
}
return 0;
}
void printSchedule(const DailySchedule& sched)
{
int day = 0;
for(auto s : sched)
{
cout << "Day " << day << ": ";
for(auto nurse : s)
{
cout << nurse << " ";
}
cout << endl;
day++;
}
}