Processing math: 100%
Dynamical system model
All Classes Namespaces Files Functions Pages
dsf::RoadDynamics< delay_t > Class Template Referenceabstract

The RoadDynamics class represents the dynamics of the network. More...

#include <RoadDynamics.hpp>

Inheritance diagram for dsf::RoadDynamics< delay_t >:
dsf::Dynamics< RoadNetwork >

Public Member Functions

 RoadDynamics (RoadNetwork &graph, bool useCache=false, std::optional< unsigned int > seed=std::nullopt, PathWeight const weightFunction=PathWeight::TRAVELTIME, std::optional< double > weightTreshold=std::nullopt)
 Construct a new RoadDynamics object.
 
void setErrorProbability (double errorProbability)
 Set the error probability.
 
void setPassageProbability (double passageProbability)
 Set the passage probability.
 
void setWeightFunction (PathWeight const pathWeight, std::optional< double > weigthThreshold=std::nullopt)
 
void setForcePriorities (bool forcePriorities) noexcept
 Set the force priorities flag.
 
void setDataUpdatePeriod (delay_t dataUpdatePeriod) noexcept
 Set the data update period.
 
void setMaxDistance (double const maxDistance)
 Set the maximum distance which a random agent can travel.
 
void setMaxTravelTime (Time const maxTravelTime) noexcept
 Set the maximum travel time which a random agent can travel.
 
void setOriginNodes (std::unordered_map< Id, double > const &originNodes)
 
void setDestinationNodes (std::unordered_map< Id, double > const &destinationNodes)
 
void setDestinationNodes (std::initializer_list< Id > destinationNodes)
 Set the destination nodes.
 
template<typename TContainer>
requires (std::is_convertible_v<typename TContainer::value_type, Id>)
void setDestinationNodes (TContainer const &destinationNodes)
 Set the destination nodes.
 
virtual void setAgentSpeed (std::unique_ptr< Agent > const &pAgent)=0
 
void initTurnCounts ()
 Initialize the turn counts map.
 
void resetTurnCounts ()
 Reset the turn counts map values to zero.
 
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 agents uniformly on the road network.
 
template<typename TContainer>
requires (std::is_same_v<TContainer, std::unordered_map<Id, double>> || std::is_same_v<TContainer, std::map<Id, double>>)
void addAgentsRandomly (Size nAgents, const TContainer &src_weights, const TContainer &dst_weights)
 Add a set of agents to the simulation.
 
void addAgentsRandomly (Size nAgents)
 
void addAgent (std::unique_ptr< Agent > agent)
 Add an agent to the simulation.
 
template<typename... TArgs>
requires (std::is_constructible_v<Agent, Time, TArgs...>)
void addAgent (TArgs &&... args)
 
template<typename... TArgs>
requires (std::is_constructible_v<Agent, Time, TArgs...>)
void addAgents (Size nAgents, TArgs &&... args)
 
template<typename... TArgs>
requires (std::is_constructible_v<Itinerary, TArgs...>)
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 (TrafficLightOptimization optimizationType=TrafficLightOptimization::DOUBLE_TAIL, const std::string &logFile=std::string(), double const percentage=0.3, double const threshold=1.3)
 Optimize the traffic lights by changing the green and red times.
 
const std::unordered_map< Id, std::unique_ptr< Itinerary > > & itineraries () const noexcept
 Get the itineraries.
 
std::unordered_map< Id, double > const & originNodes () const noexcept
 Get the origin nodes of the graph.
 
std::unordered_map< Id, double > & originNodes () noexcept
 Get the origin nodes of the graph.
 
std::unordered_map< Id, double > const & destinationNodes () const noexcept
 Get the destination nodes of the graph.
 
std::unordered_map< Id, double > & destinationNodes () noexcept
 Get the destination nodes of the graph.
 
const std::vector< std::unique_ptr< Agent > > & agents () const noexcept
 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.
 
std::unordered_map< Id, std::unordered_map< Id, size_t > > const & turnCounts () const noexcept
 Get the turn counts of the agents.
 
std::unordered_map< Id, std::unordered_map< Id, double > > const normalizedTurnCounts () const noexcept
 Get the normalized turn counts of the agents.
 
std::unordered_map< Id, std::array< long, 4 > > turnMapping () const
 
virtual double streetMeanSpeed (Id streetId) const
 
virtual Measurement< double > streetMeanSpeed () const
 
virtual Measurement< double > streetMeanSpeed (double, bool) const
 
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 saveTravelData (const std::string &filename, bool reset=false)
 Save the travel data of the agents in csv format.
 
void saveMacroscopicObservables (const std::string &filename, char const separator=';')
 Save the main macroscopic observables in csv format.
 
- Public Member Functions inherited from dsf::Dynamics< RoadNetwork >
 Dynamics (RoadNetwork &graph, std::optional< unsigned int > seed=std::nullopt)
 Construct a new Dynamics object.
 
void resetTime ()
 Reset the simulation time to 0.
 
const RoadNetworkgraph () const
 Get the graph.
 
Time time () const
 Get the current simulation time-step.
 

Protected Attributes

std::unordered_map< Id, std::unordered_map< Id, size_t > > m_turnCounts
 
std::unordered_map< Id, std::array< long, 4 > > m_turnMapping
 
tbb::concurrent_unordered_map< Id, std::unordered_map< Direction, double > > m_queuesAtTrafficLights
 
tbb::concurrent_vector< std::pair< double, double > > m_travelDTs
 
Time m_previousOptimizationTime
 
Time m_previousSpireTime
 
- Protected Attributes inherited from dsf::Dynamics< RoadNetwork >
tbb::task_arena m_taskArena
 
Time m_time
 
std::mt19937_64 m_generator
 

Additional Inherited Members

- Protected Member Functions inherited from dsf::Dynamics< RoadNetwork >
void m_evolve ()
 

Detailed Description

template<typename delay_t>
requires (is_numeric_v<delay_t>)
class dsf::RoadDynamics< delay_t >

The RoadDynamics class represents the dynamics of the network.

Template Parameters
delay_tThe type of the agent's delay

Constructor & Destructor Documentation

◆ RoadDynamics()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
dsf::RoadDynamics< delay_t >::RoadDynamics ( RoadNetwork & graph,
bool useCache = false,
std::optional< unsigned int > seed = std::nullopt,
PathWeight const weightFunction = PathWeight::TRAVELTIME,
std::optional< double > weightTreshold = std::nullopt )

Construct a new RoadDynamics object.

Parameters
graphThe graph representing the network
useCacheIf true, the cache is used (default is false)
seedThe seed for the random number generator (default is std::nullopt)
weightFunctionThe dsf::PathWeight function to use for the pathfinding (default is dsf::PathWeight::TRAVELTIME)
weightTresholdThe weight treshold for updating the paths (default is std::nullopt)

Member Function Documentation

◆ addAgent()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::addAgent ( std::unique_ptr< Agent > agent)

Add an agent to the simulation.

Parameters
agentstd::unique_ptr to the agent

◆ addAgentsRandomly()

template<typename delay_t>
requires (std::is_same_v<TContainer, std::unordered_map<Id, double>> || std::is_same_v<TContainer, std::map<Id, double>>)
template<typename TContainer>
requires (std::is_same_v<TContainer, std::unordered_map<Id, double>> || std::is_same_v<TContainer, std::map<Id, double>>)
void dsf::RoadDynamics< delay_t >::addAgentsRandomly ( Size nAgents,
const TContainer & src_weights,
const TContainer & dst_weights )

Add a set of agents to the simulation.

Parameters
nAgentsThe number of agents to add
src_weightsThe weights of the source nodes
dst_weightsThe weights of the destination nodes
Exceptions
std::invalid_argumentIf the source and destination nodes are the same

◆ addAgentsUniformly()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::addAgentsUniformly ( Size nAgents,
std::optional< Id > itineraryId = std::nullopt )

Add agents uniformly on the road network.

Parameters
nAgentsThe number of agents to add
itineraryIdThe id of the itinerary to use (default is std::nullopt)
Exceptions
std::runtime_errorIf there are no itineraries

◆ addItinerary() [1/2]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::addItinerary ( std::unique_ptr< Itinerary > itinerary)

Add an itinerary.

Parameters
itinerarystd::unique_ptr to the itinerary
Exceptions
std::invalid_argumentIf the itinerary already exists
std::invalid_argumentIf the itinerary's destination is not a node of the graph

◆ addItinerary() [2/2]

template<typename delay_t>
requires (std::is_constructible_v<Itinerary, TArgs...>)
template<typename... TArgs>
requires (std::is_constructible_v<Itinerary, TArgs...>)
void dsf::RoadDynamics< delay_t >::addItinerary ( TArgs &&... args)

Add an itinerary.

Parameters
...argsThe arguments to construct the itinerary

The arguments must be compatible with any constructor of the Itinerary class

◆ agents()

template<typename delay_t>
const std::vector< std::unique_ptr< Agent > > & dsf::RoadDynamics< delay_t >::agents ( ) const
inlinenoexcept

Get the agents.

Returns
const std::unordered_map<Id, Agent<Id>>&, The agents

◆ destinationNodes() [1/2]

template<typename delay_t>
std::unordered_map< Id, double > const & dsf::RoadDynamics< delay_t >::destinationNodes ( ) const
inlinenoexcept

Get the destination nodes of the graph.

Returns
std::unordered_map<Id, double> const& The destination nodes of the graph

◆ destinationNodes() [2/2]

template<typename delay_t>
std::unordered_map< Id, double > & dsf::RoadDynamics< delay_t >::destinationNodes ( )
inlinenoexcept

Get the destination nodes of the graph.

Returns
std::unordered_map<Id, double>& The destination nodes of the graph

◆ evolve()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::evolve ( bool reinsert_agents = false)

Evolve the simulation.

Evolve the simulation by moving the agents and updating the travel times. In particular:

  • Move the first agent of each street queue, if possible, putting it in the next node
  • Move the agents from each node, if possible, putting them in the next street and giving them a speed. If the error probability is not zero, the agents can move to a random street. If the agent is in the destination node, it is removed from the simulation (and then reinserted if reinsert_agents is true)
  • Cycle over agents and update their times
    Parameters
    reinsert_agentsIf true, the agents are reinserted in the simulation after they reach their destination

◆ initTurnCounts()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::initTurnCounts ( )

Initialize the turn counts map.

Exceptions
std::runtime_errorif the turn counts map is already initialized

◆ itineraries()

template<typename delay_t>
const std::unordered_map< Id, std::unique_ptr< Itinerary > > & dsf::RoadDynamics< delay_t >::itineraries ( ) const
inlinenoexcept

Get the itineraries.

Returns
const std::unordered_map<Id, Itinerary>&, The itineraries

◆ meanSpireInputFlow()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::meanSpireInputFlow ( bool resetValue = true)

Get the mean spire input flow of the streets in s^{-1}.

Parameters
resetValueIf true, the spire input/output flows are cleared after the computation
Returns
Measurement<double> The mean spire input flow of the streets and the standard deviation

The spire input flow is computed as the sum of counts over the product of the number of spires and the time delta

◆ meanSpireOutputFlow()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::meanSpireOutputFlow ( bool resetValue = true)

Get the mean spire output flow of the streets in s^{-1}.

Parameters
resetValueIf true, the spire output/input flows are cleared after the computation
Returns
Measurement<double> The mean spire output flow of the streets and the standard deviation

The spire output flow is computed as the sum of counts over the product of the number of spires and the time delta

◆ meanTravelDistance()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::meanTravelDistance ( bool clearData = false)

Get the mean travel distance of the agents in m.

Parameters
clearDataIf true, the travel distances are cleared after the computation
Returns
Measurement<double> The mean travel distance of the agents and the standard deviation

◆ meanTravelSpeed()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::meanTravelSpeed ( bool clearData = false)

Get the mean travel speed of the agents in m/s.

Parameters
clearDataIf true, the travel times and distances are cleared after the computation
Returns
Measurement<double> The mean travel speed of the agents and the standard deviation

◆ meanTravelTime()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::meanTravelTime ( bool clearData = false)

Get the mean travel time of the agents in s.

Parameters
clearDataIf true, the travel times are cleared after the computation
Returns
Measurement<double> The mean travel time of the agents and the standard deviation

◆ nAgents()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Size dsf::RoadDynamics< delay_t >::nAgents ( ) const

Get the number of agents currently in the simulation.

Returns
Size The number of agents

◆ normalizedTurnCounts()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
std::unordered_map< Id, std::unordered_map< Id, double > > const dsf::RoadDynamics< delay_t >::normalizedTurnCounts ( ) const
noexcept

Get the normalized turn counts of the agents.

Returns
const std::unordered_map<Id, std::unordered_map<Id, double>>& The normalized turn counts. The outer map's key is the street id, the inner map's key is the next street id and the value is the normalized number of counts

◆ optimizeTrafficLights()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::optimizeTrafficLights ( TrafficLightOptimization optimizationType = TrafficLightOptimization::DOUBLE_TAIL,
const std::string & logFile = std::string(),
double const percentage = 0.3,
double const threshold = 1.3 )

Optimize the traffic lights by changing the green and red times.

Parameters
optimizationTypeTrafficLightOptimization, The type of optimization. Default is DOUBLE_TAIL
logFileThe file into which write the logs (default is empty, meaning no logging)
percentagedouble, the maximum amount (percentage) of the green time to change (default is 0.3)
thresholddouble, The ratio between the self-density and neighbour density to trigger the non-local optimization (default is 1.3)

The local optimization is done by changing the green time of each traffic light, trying to make it proportional to the queue lengths at each phase. The non-local optimization is done by synchronizing the traffic lights which are congested over threshold.

◆ originNodes() [1/2]

template<typename delay_t>
std::unordered_map< Id, double > const & dsf::RoadDynamics< delay_t >::originNodes ( ) const
inlinenoexcept

Get the origin nodes of the graph.

Returns
std::unordered_map<Id, double> const& The origin nodes of the graph

◆ originNodes() [2/2]

template<typename delay_t>
std::unordered_map< Id, double > & dsf::RoadDynamics< delay_t >::originNodes ( )
inlinenoexcept

Get the origin nodes of the graph.

Returns
std::unordered_map<Id, double>& The origin nodes of the graph

◆ resetTurnCounts()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::resetTurnCounts ( )

Reset the turn counts map values to zero.

Exceptions
std::runtime_errorif the turn counts map is not initialized

◆ saveInputStreetCounts()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::saveInputStreetCounts ( const std::string & filename,
bool reset = false,
char const separator = ';' )

Save the street input counts in csv format.

Parameters
filenameThe name of the file
resetIf true, the input counts are cleared after the computation

NOTE: counts are printed only if the street is a spire

◆ saveMacroscopicObservables()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::saveMacroscopicObservables ( const std::string & filename,
char const separator = ';' )

Save the main macroscopic observables in csv format.

Parameters
filenameThe name of the file
separatorThe separator character (default is ';')

The file contains the following columns:

  • time: the time of the simulation
  • n_agents: the number of agents currently in the simulation
  • mean_speed - mean_speed_std: the mean speed of the agents
  • mean_density - mean_density_std: the (normalized) mean density of the streets
  • mean_flow - mean_flow_std: the mean flow of the streets
  • mean_flow_spires - mean_flow_spires_std: the mean flow of the spires
  • mean_traveltime - mean_traveltime_std: the mean travel time of the agents
  • mean_traveldistance - mean_traveldistance_err: the mean travel distance of the agents
  • mean_travelspeed - mean_travelspeed_std: the mean travel speed of the agents

NOTE: the mean density is normalized in [0, 1] and reset is true for all observables which have such parameter

◆ saveOutputStreetCounts()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::saveOutputStreetCounts ( const std::string & filename,
bool reset = false,
char const separator = ';' )

Save the street output counts in csv format.

Parameters
filenameThe name of the file
resetIf true, the output counts are cleared after the computation

NOTE: counts are printed only if the street is a spire

◆ saveStreetDensities()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::saveStreetDensities ( const std::string & filename,
bool normalized = true,
char const separator = ';' ) const

Save the street densities in csv format.

Parameters
filenameThe name of the file
normalizedIf true, the densities are normalized in [0, 1]

◆ saveTravelData()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::saveTravelData ( const std::string & filename,
bool reset = false )

Save the travel data of the agents in csv format.

The file contains the following columns:

  • time: the time of the simulation
  • distances: the travel distances of the agents
  • times: the travel times of the agents
  • speeds: the travel speeds of the agents
    Parameters
    filenameThe name of the file
    resetIf true, the travel speeds are cleared after the computation

◆ setAgentSpeed()

template<typename delay_t>
virtual void dsf::RoadDynamics< delay_t >::setAgentSpeed ( std::unique_ptr< Agent > const & pAgent)
pure virtual

Implemented in dsf::FirstOrderDynamics.

◆ setDataUpdatePeriod()

template<typename delay_t>
void dsf::RoadDynamics< delay_t >::setDataUpdatePeriod ( delay_t dataUpdatePeriod)
inlinenoexcept

Set the data update period.

Parameters
dataUpdatePerioddelay_t, The period

Some data, i.e. the street queue lengths, are stored only after a fixed amount of time which is represented by this variable.

◆ setDestinationNodes() [1/2]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::setDestinationNodes ( std::initializer_list< Id > destinationNodes)

Set the destination nodes.

Parameters
destinationNodesThe destination nodes (as an initializer list)

◆ setDestinationNodes() [2/2]

template<typename delay_t>
requires (std::is_convertible_v<typename TContainer::value_type, Id>)
template<typename TContainer>
requires (std::is_convertible_v<typename TContainer::value_type, Id>)
void dsf::RoadDynamics< delay_t >::setDestinationNodes ( TContainer const & destinationNodes)

Set the destination nodes.

Parameters
destinationNodesA container of destination nodes ids

The container must have a value_type convertible to Id and begin() and end() methods

◆ setErrorProbability()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::setErrorProbability ( double errorProbability)

Set the error probability.

Parameters
errorProbabilityThe error probability
Exceptions
std::invalid_argumentIf the error probability is not between 0 and 1

◆ setForcePriorities()

template<typename delay_t>
void dsf::RoadDynamics< delay_t >::setForcePriorities ( bool forcePriorities)
inlinenoexcept

Set the force priorities flag.

Parameters
forcePrioritiesThe flag

If true, if an agent cannot move to the next street, the whole node is skipped

◆ setMaxDistance()

template<typename delay_t>
void dsf::RoadDynamics< delay_t >::setMaxDistance ( double const maxDistance)
inline

Set the maximum distance which a random agent can travel.

Parameters
maxDistanceThe maximum distance
Exceptions
std::invalid_argumentIf the maximum distance is negative

◆ setMaxTravelTime()

template<typename delay_t>
void dsf::RoadDynamics< delay_t >::setMaxTravelTime ( Time const maxTravelTime)
inlinenoexcept

Set the maximum travel time which a random agent can travel.

Parameters
maxTravelTimeThe maximum travel time

◆ setPassageProbability()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
void dsf::RoadDynamics< delay_t >::setPassageProbability ( double passageProbability)

Set the passage probability.

Parameters
passageProbabilityThe passage probability

The passage probability is the probability of passing through a node It is useful in the case of random agents

◆ streetMeanDensity()

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::streetMeanDensity ( bool normalized = false) const

Get the mean density of the streets in m^{-1}.

Returns
Measurement<double> The mean density of the streets and the standard deviation

◆ streetMeanFlow() [1/2]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::streetMeanFlow ( ) const

Get the mean flow of the streets in s^{-1}.

Returns
Measurement<double> The mean flow of the streets and the standard deviation

◆ streetMeanFlow() [2/2]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::streetMeanFlow ( double threshold,
bool above ) const

Get the mean flow of the streets in s^{-1}.

Parameters
thresholdThe density threshold to consider
aboveIf true, the function returns the mean flow of the streets with a density above the threshold, otherwise below
Returns
Measurement<double> The mean flow of the streets and the standard deviation

◆ streetMeanSpeed() [1/3]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::streetMeanSpeed ( ) const
virtual

Reimplemented in dsf::FirstOrderDynamics.

◆ streetMeanSpeed() [2/3]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
Measurement< double > dsf::RoadDynamics< delay_t >::streetMeanSpeed ( double threshold,
bool above ) const
virtual

Reimplemented in dsf::FirstOrderDynamics.

◆ streetMeanSpeed() [3/3]

template<typename delay_t>
requires (is_numeric_v<delay_t>)
double dsf::RoadDynamics< delay_t >::streetMeanSpeed ( Id streetId) const
virtual

Reimplemented in dsf::FirstOrderDynamics.

◆ turnCounts()

template<typename delay_t>
std::unordered_map< Id, std::unordered_map< Id, size_t > > const & dsf::RoadDynamics< delay_t >::turnCounts ( ) const
inlinenoexcept

Get the turn counts of the agents.

Returns
const std::unordered_map<Id, std::unordered_map<Id, size_t>>& The turn counts. The outer map's key is the street id, the inner map's key is the next street id and the value is the number of counts

The documentation for this class was generated from the following file: