|
| FirstOrderDynamics (RoadNetwork &graph, bool useCache=false, std::optional< unsigned int > seed=std::nullopt, double alpha=0., std::function< double(const RoadNetwork *, Id, Id)> weightFunction=weight_functions::streetTime, double weightTreshold=60.) |
| Construct a new First Order Dynamics object.
|
|
void | setAgentSpeed (Size agentId) override |
| Set the speed of an agent.
|
|
void | setSpeedFluctuationSTD (double speedFluctuationSTD) |
| Set the standard deviation of the speed fluctuation.
|
|
double | streetMeanSpeed (Id streetId) const override |
| Get the mean speed of a street in \(m/s\).
|
|
Measurement< double > | streetMeanSpeed () const override |
| Get the mean speed of the streets in \(m/s\).
|
|
Measurement< double > | streetMeanSpeed (double threshold, bool above) const override |
| Get the mean speed of the streets with density above or below a threshold in \(m/s\).
|
|
| RoadDynamics (RoadNetwork &graph, bool useCache=false, std::optional< unsigned int > seed=std::nullopt, std::function< double(const RoadNetwork *, Id, Id)> weightFunction=weight_functions::streetTime, double weightTreshold=60.) |
| Construct a new RoadDynamics object.
|
|
void | setErrorProbability (double errorProbability) |
| Set the error probability.
|
|
void | setPassageProbability (double passageProbability) |
|
void | setForcePriorities (bool forcePriorities) |
| Set the force priorities flag.
|
|
void | setDataUpdatePeriod (Delay dataUpdatePeriod) |
| Set the data update period.
|
|
void | setDestinationNodes (std::initializer_list< Id > destinationNodes, bool updatePaths=true) |
| Set the destination nodes.
|
|
void | setDestinationNodes (TContainer const &destinationNodes, bool updatePaths=true) |
| Set the destination nodes.
|
|
void | updatePaths () |
| Update the paths of the itineraries based on the given weight function.
|
|
void | addAgentsUniformly (Size nAgents, std::optional< Id > itineraryId=std::nullopt) |
| Add a set of agents to the simulation.
|
|
void | addAgentsRandomly (Size nAgents, const TContainer &src_weights, const TContainer &dst_weights, const size_t minNodeDistance=0) |
| Add a set of agents to the simulation.
|
|
void | addAgentsRandomly (Size nAgents, const size_t minNodeDistance=0) |
|
void | addAgent (std::unique_ptr< Agent > agent) |
| Add an agent to the simulation.
|
|
void | addAgent (TArgs &&... args) |
|
void | addAgents (Size nAgents, TArgs &&... args) |
|
void | removeAgent (Size agentId) |
| Remove an agent from the simulation.
|
|
void | removeAgents (T1 id, Tn... ids) |
|
void | addItinerary (TArgs &&... args) |
| Add an itinerary.
|
|
void | addItinerary (std::unique_ptr< Itinerary > itinerary) |
| Add an itinerary.
|
|
void | evolve (bool reinsert_agents=false) |
| Evolve the simulation.
|
|
void | optimizeTrafficLights (double const threshold=0., TrafficLightOptimization optimizationType=TrafficLightOptimization::DOUBLE_TAIL) |
| Optimize the traffic lights by changing the green and red times.
|
|
const std::unordered_map< Id, std::unique_ptr< Itinerary > > & | itineraries () const |
| Get the itineraries.
|
|
const std::map< Id, std::unique_ptr< Agent > > & | agents () const |
| Get the agents.
|
|
Size | nAgents () const |
| Get the number of agents currently in the simulation.
|
|
Measurement< double > | meanTravelTime (bool clearData=false) |
| Get the mean travel time of the agents in \(s\).
|
|
Measurement< double > | meanTravelDistance (bool clearData=false) |
| Get the mean travel distance of the agents in \(m\).
|
|
Measurement< double > | meanTravelSpeed (bool clearData=false) |
| Get the mean travel speed of the agents in \(m/s\).
|
|
const std::unordered_map< Id, std::array< unsigned long long, 4 > > & | turnCounts () const |
| Get the turn counts of the agents.
|
|
std::unordered_map< Id, std::array< double, 4 > > | turnProbabilities (bool reset=true) |
| Get the turn probabilities of the agents.
|
|
std::unordered_map< Id, std::array< long, 4 > > | turnMapping () const |
|
Measurement< double > | agentMeanSpeed () const |
| Get the mean speed of the agents in \(m/s\).
|
|
Measurement< double > | streetMeanDensity (bool normalized=false) const |
| Get the mean density of the streets in \(m^{-1}\).
|
|
Measurement< double > | streetMeanFlow () const |
| Get the mean flow of the streets in \(s^{-1}\).
|
|
Measurement< double > | streetMeanFlow (double threshold, bool above) const |
| Get the mean flow of the streets in \(s^{-1}\).
|
|
Measurement< double > | meanSpireInputFlow (bool resetValue=true) |
| Get the mean spire input flow of the streets in \(s^{-1}\).
|
|
Measurement< double > | meanSpireOutputFlow (bool resetValue=true) |
| Get the mean spire output flow of the streets in \(s^{-1}\).
|
|
void | saveStreetDensities (const std::string &filename, bool normalized=true, char const separator=';') const |
| Save the street densities in csv format.
|
|
void | saveInputStreetCounts (const std::string &filename, bool reset=false, char const separator=';') |
| Save the street input counts in csv format.
|
|
void | saveOutputStreetCounts (const std::string &filename, bool reset=false, char const separator=';') |
| Save the street output counts in csv format.
|
|
void | saveTravelSpeeds (const std::string &filename, bool reset=false) |
| Save the travel speeds of the agents in csv format.
|
|
void | saveMacroscopicObservables (const std::string &filename, char const separator=';') |
| Save the main macroscopic observables in csv format.
|
|
| Dynamics (RoadNetwork &graph, std::optional< unsigned int > seed=std::nullopt) |
| Construct a new Dynamics object.
|
|
void | resetTime () |
| Reset the simulation time to 0.
|
|
const RoadNetwork & | graph () const |
| Get the graph.
|
|
Time | time () const |
| Get the current simulation time-step.
|
|