1 | /*! |
---|
2 | \file |
---|
3 | \brief DataSource for experiments with Aimsun |
---|
4 | \author Jan Prikryl. |
---|
5 | |
---|
6 | */ |
---|
7 | |
---|
8 | #include <base/loggers.h> |
---|
9 | |
---|
10 | using namespace bdm; |
---|
11 | |
---|
12 | //! Simulator of traffic - AIMSUN |
---|
13 | class AimsunDS : public DS |
---|
14 | { |
---|
15 | |
---|
16 | protected: |
---|
17 | //! indeces of logged variables |
---|
18 | int L_x, L_ou, L_oy, L_iu, L_optu; |
---|
19 | //! Setpoints of omega in timespans given by dt_prof |
---|
20 | vec profileWw; |
---|
21 | //! Setpoints of Mz in timespans given by dt_prof |
---|
22 | vec profileMz; |
---|
23 | //! time-step for profiles |
---|
24 | double dt_prof; |
---|
25 | //! Number of miliseconds per discrete time step |
---|
26 | int Dt; |
---|
27 | //! options for logging, - log predictions of 'true' voltage |
---|
28 | bool opt_modu; |
---|
29 | //! options for logging, - |
---|
30 | eh_els3hrd * p_rsp; |
---|
31 | //! pointer to realised signal plans stored in local data space of eh_api */ |
---|
32 | |
---|
33 | public: |
---|
34 | //! Constructor with fixed sampling period |
---|
35 | AimsunDS (); |
---|
36 | |
---|
37 | //! Get measurements and signal plans from ELS3 controllers |
---|
38 | void getdata ( vec &dt ) const; |
---|
39 | |
---|
40 | //! Write new signal plans to ELS3 |
---|
41 | void write ( vec &ut ); |
---|
42 | |
---|
43 | //! Wait for new data and copy them out to local buffers |
---|
44 | void step(); |
---|
45 | |
---|
46 | // TODO dodelat void to_setting( Setting &root ) const; |
---|
47 | private: |
---|
48 | void AimsunDS::initVGS ( |
---|
49 | const vgs_headway_mode headway, |
---|
50 | const TCHAR * entrancePath, |
---|
51 | const TCHAR * sectionStatsPath, |
---|
52 | const TCHAR * globalStatsPath |
---|
53 | ); |
---|
54 | }; |
---|