root/applications/doprava/aimsun_bdm/aimsun_ds.h @ 1132

Revision 1089, 1.6 kB (checked in by ondrak, 14 years ago)

Added option to set simulation length in number of cycles

Line 
1/*!
2  \file
3  \brief DataSource for experiments with Aimsun
4  \author Jan Prikryl.
5
6*/
7
8/* WIN32 stuff */
9#include <windows.h>
10#include <stdio.h>
11#include <tchar.h>
12
13#include <base/loggers.h>
14
15extern "C" {
16  #include "eh_hrd.h"
17  #include "vgs_hrd.h"
18}
19
20using namespace bdm;
21
22//! Simulator of traffic - AIMSUN
23class AimsunDS : public DS
24{
25
26protected:
27        //! Pointer to realised signal plans stored in local data space of eh_api.
28        eh_els3hrd * p_rsp;
29
30        //! Target buffer when querying VGS for last section statistics data.
31        vgs_sections_stats sections_stats;
32
33public:
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        //! number of steps
47        int max_length() {return stopCycle;}
48
49        //! converts i to string, if i has only one digit, adds 0 before it
50        string int_to_string(int const i);
51
52        virtual void from_setting ( const Setting &cfg );
53        virtual void validate ( void );
54       
55    // TODO dodelat void to_setting( Setting &root ) const;
56private:
57        //! File name containing vehicle entrances into the network
58        string entranceFileName;
59       
60        //! Stop time of the simulation
61        string stopTime;
62
63        //! Number of cycles of the simulation
64        int stopCycle;
65       
66        void AimsunDS::initVGS (
67                const vgs_headway_mode headway,
68                const string &entrancePath,
69                const string &sectionStatsPath,
70                const string &globalStatsPath
71        );
72
73};
74UIREGISTER(AimsunDS);
Note: See TracBrowser for help on using the browser.