Stride Reference Manual  1.0
TravellerScheduleReader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <array>
6 #include <boost/property_tree/ptree.hpp>
7 #include <boost/property_tree/xml_parser.hpp>
8 
9 using namespace std;
10 
11 namespace stride {
12 
13 class Coordinator;
14 
15 namespace util {
16 
17 using uint = unsigned int;
18 
19 struct Flight {
20  Flight(string source_sim, string destination_sim, uint amount, uint duration, uint day_of_the_week, string district,
21  string facility)
22  : m_source_sim(source_sim),
23  m_destination_sim(destination_sim),
24  m_amount(amount),
25  m_duration(duration),
26  m_day_of_the_week(day_of_the_week),
27  m_district(district),
28  m_facility(facility) {}
29 
30  ~Flight() {}
31 
32  string m_source_sim;
37  string m_district;
38  string m_facility;
39 
40 };
41 
42 bool operator==(const Flight& flight1, const Flight& flight2);
43 
44 using Schedule = array<vector<Flight>, 7>;
45 
47 public:
49  Schedule readSchedule(string filename);
50 
51 private:
52  void parseTree(string filename);
53 
54  Flight parseFlight(boost::property_tree::ptree& node) const;
55 
56  boost::property_tree::ptree m_pt;
57 };
58 
59 }
60 }
unsigned int uint
Definition: Influence.h:17
string m_district
The current day of the week (0 (Sunday), ..., 6 (Saturday))
Time Dependent Person DataType.
Definition: NoBehaviour.h:17
bool operator==(const Flight &flight1, const Flight &flight2)
array< vector< Flight >, 7 > Schedule
STL namespace.
Flight(string source_sim, string destination_sim, uint amount, uint duration, uint day_of_the_week, string district, string facility)