Revision 902, 1.3 kB
(checked in by prikryl, 14 years ago)
|
Crashes in UI::get()
|
Rev | Line | |
---|
[814] | 1 | /*! |
---|
| 2 | \file |
---|
| 3 | \brief DataSource for experiments with Aimsun |
---|
[825] | 4 | \author Jan Prikryl. |
---|
[814] | 5 | |
---|
| 6 | */ |
---|
| 7 | |
---|
[829] | 8 | /* WIN32 stuff */ |
---|
| 9 | #include <windows.h> |
---|
| 10 | #include <stdio.h> |
---|
| 11 | #include <tchar.h> |
---|
| 12 | |
---|
[814] | 13 | #include <base/loggers.h> |
---|
| 14 | |
---|
[829] | 15 | extern "C" { |
---|
| 16 | #include "eh_hrd.h" |
---|
| 17 | #include "vgs_hrd.h" |
---|
| 18 | } |
---|
| 19 | |
---|
[814] | 20 | using namespace bdm; |
---|
| 21 | |
---|
| 22 | //! Simulator of traffic - AIMSUN |
---|
| 23 | class AimsunDS : public DS |
---|
| 24 | { |
---|
| 25 | |
---|
| 26 | protected: |
---|
[825] | 27 | eh_els3hrd * p_rsp; |
---|
| 28 | //! pointer to realised signal plans stored in local data space of eh_api */ |
---|
| 29 | |
---|
[814] | 30 | public: |
---|
| 31 | //! Constructor with fixed sampling period |
---|
[902] | 32 | AimsunDS (); |
---|
[814] | 33 | |
---|
[825] | 34 | //! Get measurements and signal plans from ELS3 controllers |
---|
| 35 | void getdata ( vec &dt ) const; |
---|
[814] | 36 | |
---|
[825] | 37 | //! Write new signal plans to ELS3 |
---|
| 38 | void write ( vec &ut ); |
---|
[814] | 39 | |
---|
[825] | 40 | //! Wait for new data and copy them out to local buffers |
---|
| 41 | void step(); |
---|
[840] | 42 | |
---|
| 43 | //! number of steps |
---|
| 44 | int max_length() {return 960;} |
---|
[902] | 45 | |
---|
| 46 | virtual void from_setting ( const Setting &cfg ); |
---|
| 47 | virtual void validate ( void ); |
---|
[840] | 48 | |
---|
[814] | 49 | // TODO dodelat void to_setting( Setting &root ) const; |
---|
[825] | 50 | private: |
---|
[902] | 51 | //! File name containing vehicle entrances into the network |
---|
| 52 | string entranceFileName; |
---|
| 53 | |
---|
| 54 | //! Stip time of the simulation |
---|
| 55 | string stopTime; |
---|
| 56 | |
---|
[825] | 57 | void AimsunDS::initVGS ( |
---|
| 58 | const vgs_headway_mode headway, |
---|
[844] | 59 | const string &entrancePath, |
---|
| 60 | const string §ionStatsPath, |
---|
| 61 | const string &globalStatsPath |
---|
[825] | 62 | ); |
---|
[902] | 63 | |
---|
[814] | 64 | }; |
---|