-
Notifications
You must be signed in to change notification settings - Fork 29
Bus Controller
When user enable the bus controller, the SimMobility will simulate the buses’ movement on the road network. Bus controller as a central control, can dispatch buses as scheduled time along different bus lines. So that buses will move along predefined routes and passengers will board on or alight from buses when they are stopping at bus stops . To activate the bus controller, you can use following element in the configuration file of simrun_MidTerm.xml
or simrun_ShortTerm.xml
:
<busController enabled="true" />
If ‘enabled’ value is ‘true’, the bus controller will get active and keep dispatching the buses in the SimMobility, otherwise if ‘enabled’ value is ‘false’, no buses are simulated on the road network.
In order to run the buses simulation, the bus routes need to be provided to the supply. Three tables respectively define bus routes, bus stops and bus dispatching frequency.
pt_bus_stops
The structure of bus stops table as following, this table will define the list of bus stops at which buses need to stop to take passengers:
column | data type | explanation |
---|---|---|
route_id | string | Identify bus line |
stop_code | string | Identify bus stop |
sequence_no | integer | The index in the list |
pt_bus_routes
(Please refer here if you want to generate bus routes)
The structure of bus routes table as following, this table will define the list of bus routes along which bus will move forward:
column | data type | explanation |
---|---|---|
route_id | string | Identify bus line |
section_id | integer | Identify road segment on the map |
sequence_no | integer | The index in the list |
pt_bus_dispatch_freq
The structure of bus dispatching table as following, this table will define the frequency of bus dispatching. On those times buses will start journey at the starting stops:
column | data type | explanation |
---|---|---|
frequency_id | string | Identify bus line |
route_id | string | Identify bus line |
start_time | string | Define starting time, format like: HH:MM:SS |
end_time | string | Define ending time, format like: HH:MM:SS |
headway_sec | integer | Define how long time to dispatch next bus. The unit is scecond |
The predefined bus routes are supplied to the simulation through pt_bus_dispatch_freq, pt_bus_routes, pt_bus_stops elements under proc_maps in the simrun_MidTerm.xml
or simrun_ShortTerm.xml
file, the example as following:
<mapping name="pt_bus_dispatch_freq" procedure="get_pt_bus_frequency()"/>
<mapping name="pt_bus_routes" procedure="get_pt_bus_routes()"/>
<mapping name="pt_bus_stops" procedure="get_pt_bus_stops()"/>
<mapping name="pt_stop_stats" procedure="get_pt_stop_stats()"/>
There, you can find the corresponding stored procedures that are used to access the above three tables in the database.