-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.cpp
More file actions
67 lines (61 loc) · 1.83 KB
/
Copy pathelements.cpp
File metadata and controls
67 lines (61 loc) · 1.83 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <cstddef>
#include <iomanip>
#include <vector>
#include <algorithm>
#include "myclock.h"
#include "elements.h"
void SessionMorning::Show(){
//cout << "MORNING MEETING:" << endl;
for (vector<class Item>::iterator it = m_items.begin() ; it != m_items.end(); ++it) {
m_clk.PrintTime();
cout<< " " << it->m_name << " " << it->m_cost << "min" <<endl;
m_clk.AddMin(it->m_cost);
}
m_clk.PrintTime();
cout<< " Networking Event" <<endl;
}
void SessionAfternoon::Show(){
//cout << "AFTERNOON MEETING:" << endl;
for (vector<class Item>::iterator it = m_items.begin() ; it != m_items.end(); ++it) {
m_clk.PrintTime();
cout<< " " << it->m_name << " " << it->m_cost << "min" <<endl;
m_clk.AddMin(it->m_cost);
}
m_clk.PrintTime();
cout<< " Networking Event" <<endl;
}
void ItemSets::Show(){
for (vector<class Item>::iterator it = m_items.begin() ; it != m_items.end(); ++it) {
cout << "[name]" << it->m_name << ",[cost]" << it->m_cost << ",[is_scheduled]" << it->is_scheduled <<endl;
}
}
void ItemSets::SortItems(){
//sort items by time costs
sort(m_items.begin(),m_items.end());
reverse(m_items.begin(),m_items.end());
}
bool ItemSets::IsFinish(){
for (vector<class Item>::iterator it = m_items.begin() ; it != m_items.end(); ++it) {
if(it->is_scheduled == 0) {
return false;
}
}
return true;
}
void TrackSets::Show(){
int i = 0;
for (vector<class Track>::iterator it = m_tracks.begin() ; it != m_tracks.end(); ++it) {
if(i > m_valid_days){
return;
}
cout << "TRACK " << i+1 << endl;
it->m_morning_session.Show();
it->m_afternoon_session.Show();
i++;
}
}