|
|
| TrafficSimulator () |
| | Construct a new TrafficSimulator with a generated simulation id.
|
| | TrafficSimulator (std::string_view const jsonConfigFile) |
| | Construct a new TrafficSimulator and import its configuration from JSON.
|
| void | importConfig (std::string_view const jsonConfigFile) |
| | Import a JSON configuration file and apply it to the simulator.
|
| void | connectDataBase (std::string_view const dbPath, std::string_view const queries="PRAGMA busy_timeout = 5000;PRAGMA journal_mode = WAL;PRAGMA " "synchronous=NORMAL;PRAGMA temp_store=MEMORY;PRAGMA cache_size=-20000;") |
| | Connect to a SQLite database, creating it if it doesn't exist, and executing optional initialization queries.
|
| void | importRoadNetwork (std::string_view const edgesFile, std::string_view const nodePropertiesFile=std::string_view()) |
| | Import a road network and build the simulation dynamics.
|
| void | updatePaths (std::time_t const deltaT=0, bool const throw_on_empty=true) |
| | Configure the path-update cadence forwarded to the dynamics engine.
|
|
void | saveData (std::time_t const savingInterval, bool const saveAverageStats=false, bool const saveStreetData=false, bool const saveTravelData=false, bool const saveAgentData=false, bool const saveTurnCounts=false) |
| | Configure the data-saving behavior.
|
| void | setName (std::string_view const name) |
| | Set the name of the simulation.
|
| void | setOutputPrefix (std::string_view const prefix) |
| | Set the output prefix used for generated CSV files and database paths.
|
| void | setTimeFrame (std::time_t const initTime, std::optional< std::time_t > const endTime=std::nullopt) |
| | Set the simulation time frame.
|
| void | setAgentInsertionMethod (AgentInsertionMethod const insertionMethod) noexcept |
| | Set the strategy used when inserting new agents.
|
|
void | run (std::vector< std::size_t > const &nAgentsPerTimeStep, std::optional< std::time_t > const deltaT=std::nullopt, std::vector< std::size_t > const &nRandomAgentsPerTimeStep=std::vector< std::size_t >()) |
| | Run the simulation until the configured end time.
|
|
void | run (std::size_t const nInitialAgents, std::time_t const agentInsertionDeltaT, std::time_t const checkDeltaT, std::size_t const agentIncrement=1) |
| auto * | database () const |
| | Get the database connection (const version).
|
|
auto const * | dynamics () const |
| | Get the dynamics engine managed by this simulator.
|
|
auto * | dynamics () |
| | Get the mutable dynamics engine managed by this simulator.
|
| auto | id () const |
| | Get the id of the simulation.
|
|
auto | initTime () const |
| | Get the simulation start time.
|
|
auto | strInitTime () const |
| | Get the formatted simulation start time.
|
|
auto | endTime () const |
| | Get the simulation end time.
|
|
auto | strEndTime () const |
| | Get the formatted simulation end time.
|
| auto const & | name () const |
| | Get the name of the simulation.
|
| auto const & | safeName () const |
| | Get a safe name string for filenames (spaces replaced by underscores).
|