Dynamical system model
Loading...
Searching...
No Matches
dsm::Dynamics< Id, Size, Delay > Class Template Referenceabstract

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

#include <Dynamics.hpp>

Inheritance diagram for dsm::Dynamics< Id, Size, Delay >:
dsm::FirstOrderDynamics< Id, Size, Delay >

Public Member Functions

 Dynamics (Graph< Id, Size > &graph)
 Construct a new Dynamics object.
 
void setItineraries (std::span< Itinerary< Id > > itineraries)
 Set the itineraries.
 
void setSeed (unsigned int seed)
 Set the seed for the graph's random number generator.
 
void setMinSpeedRateo (double minSpeedRateo)
 Set the minim speed rateo, i.e. the minim speed with respect to the speed limit.
 
void setErrorProbability (double errorProbability)
 Set the error probability.
 
void setMaxFlowPercentage (double maxFlowPercentage)
 Set the maximum flow percentage.
 
virtual void setAgentSpeed (Size agentId)=0
 Set the speed of an agent.
 
void setForcePriorities (bool forcePriorities)
 Set the force priorities flag.
 
virtual void updatePaths ()
 Update the paths of the itineraries based on the actual travel times.
 
virtual void evolve (bool reinsert_agents=false)
 Evolve the simulation.
 
void optimizeTrafficLights (double percentage, double threshold=0.)
 Optimize the traffic lights by changing the green and red times.
 
const Graph< Id, Size > & graph () const
 Get the graph.
 
const std::unordered_map< Id, std::unique_ptr< Itinerary< Id > > > & itineraries () const
 Get the itineraries.
 
const std::map< Id, std::unique_ptr< Agent< Id, Size, Delay > > > & agents () const
 Get the agents.
 
TimePoint time () const
 Get the time.
 
void addAgent (const Agent< Id, Size, Delay > &agent)
 Add an agent to the simulation.
 
void addAgent (std::unique_ptr< Agent< Id, Size, Delay > > agent)
 Add an agent to the simulation.
 
void addAgents (Id itineraryId, Size nAgents=1, std::optional< Id > srcNodeId=std::nullopt)
 Add a pack of agents to the simulation.
 
template<typename... Tn>
requires (is_agent_v<Tn> && ...)
void addAgents (Tn... agents)
 Add a pack of agents to the simulation.
 
template<typename T1 , typename... Tn>
requires (is_agent_v<T1> && (is_agent_v<Tn> && ...))
void addAgents (T1 agent, Tn... agents)
 Add a pack of agents to the simulation.
 
void addAgents (std::span< Agent< Id, Size, Delay > > agents)
 Add a set of agents to the simulation.
 
virtual void addAgentsUniformly (Size nAgents, std::optional< Id > itineraryId=std::nullopt)
 Add a set of agents to the simulation.
 
void removeAgent (Size agentId)
 Remove an agent from the simulation.
 
template<typename T1 , typename... Tn>
requires (std::is_convertible_v<T1, Size> && (std::is_convertible_v<Tn, Size> && ...))
void removeAgents (T1 id, Tn... ids)
 
void addItinerary (const Itinerary< Id > &itinerary)
 Add an itinerary.
 
void addItinerary (std::unique_ptr< Itinerary< Id > > itinerary)
 Add an itinerary.
 
template<typename... Tn>
requires (is_itinerary_v<Tn> && ...)
void addItineraries (Tn... itineraries)
 
template<typename T1 , typename... Tn>
requires (is_itinerary_v<T1> && (is_itinerary_v<Tn> && ...))
void addItineraries (T1 itinerary, Tn... itineraries)
 Add a pack of itineraries.
 
void addItineraries (std::span< Itinerary< Id > > itineraries)
 Add a set of itineraries.
 
void resetTime ()
 Reset the simulation time.
 
template<typename F , typename... Tn>
requires std::is_invocable_v<F, Tn...>
void evolve (F f, Tn... args)
 Evolve the simulation.
 
Measurement< double > agentMeanSpeed () const
 Get the mean speed of the agents in $m/s$.
 
virtual double streetMeanSpeed (Id) const =0
 
virtual Measurement< double > streetMeanSpeed () const =0
 
virtual Measurement< double > streetMeanSpeed (double, bool) const =0
 
Measurement< double > streetMeanDensity () 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}$.
 
Measurement< double > meanTravelTime (bool clearData=false)
 Get the mean travel time of the agents in $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
 

Protected Member Functions

virtual Id m_nextStreetId (Id agentId, Id NodeId, std::optional< Id > streetId=std::nullopt)
 Get the next street id.
 
virtual void m_increaseTurnCounts (Id streetId, double delta)
 Increase the turn counts.
 
virtual void m_evolveStreets (bool reinsert_agents)
 Evolve the streets.
 
virtual void m_evolveNodes ()
 Evolve the nodes.
 
virtual void m_evolveAgents ()
 Evolve the agents.
 
void m_updatePath (const std::unique_ptr< Itinerary< Id > > &pItinerary)
 Update the path of a single itinerary.
 

Protected Attributes

std::unordered_map< Id, std::unique_ptr< Itinerary< Id > > > m_itineraries
 
std::map< Id, std::unique_ptr< Agent< Id, Size, Delay > > > m_agents
 
TimePoint m_time
 
TimePoint m_previousSpireTime
 
Graph< Id, Size > m_graph
 
double m_errorProbability
 
double m_minSpeedRateo
 
double m_maxFlowPercentage
 
std::mt19937_64 m_generator {std::random_device{}()}
 
std::uniform_real_distribution< double > m_uniformDist {0., 1.}
 
std::vector< unsigned int > m_travelTimes
 
std::unordered_map< Id, Id > m_agentNextStreetId
 
bool m_forcePriorities
 
std::unordered_map< Id, std::array< unsigned long long, 4 > > m_turnCounts
 
std::unordered_map< Id, std::array< long, 4 > > m_turnMapping
 

Detailed Description

template<typename Id, typename Size, typename Delay>
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
class dsm::Dynamics< Id, Size, Delay >

The Dynamics class represents the dynamics of the network.

Template Parameters
Id,Thetype of the graph's id. It must be an unsigned integral type.
Size,Thetype of the graph's capacity. It must be an unsigned integral type.

Constructor & Destructor Documentation

◆ Dynamics()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
dsm::Dynamics< Id, Size, Delay >::Dynamics ( Graph< Id, Size > & graph)

Construct a new Dynamics object.

Parameters
graphThe graph representing the network

Member Function Documentation

◆ addAgent() [1/2]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addAgent ( const Agent< Id, Size, Delay > & agent)

Add an agent to the simulation.

Parameters
agentThe agent

◆ addAgent() [2/2]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addAgent ( std::unique_ptr< Agent< Id, Size, Delay > > agent)

Add an agent to the simulation.

Parameters
agentstd::unique_ptr to the agent

◆ addAgents() [1/4]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addAgents ( Id itineraryId,
Size nAgents = 1,
std::optional< Id > srcNodeId = std::nullopt )

Add a pack of agents to the simulation.

Parameters
itineraryIdThe index of the itinerary
nAgentsThe number of agents to add
Exceptions
std::invalid_argumentIf the itinerary is not found

adds nAgents agents with the same itinerary of id itineraryId

◆ addAgents() [2/4]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addAgents ( std::span< Agent< Id, Size, Delay > > agents)

Add a set of agents to the simulation.

Parameters
agentsGeneric container of agents, represented by an std::span

◆ addAgents() [3/4]

template<typename Id , typename Size , typename Delay >
requires (is_agent_v<T1> && (is_agent_v<Tn> && ...))
template<typename T1 , typename... Tn>
requires (is_agent_v<T1> && (is_agent_v<Tn> && ...))
void dsm::Dynamics< Id, Size, Delay >::addAgents ( T1 agent,
Tn... agents )

Add a pack of agents to the simulation.

Parameters
agentAn agent
agentsParameter pack of agents

◆ addAgents() [4/4]

template<typename Id , typename Size , typename Delay >
requires (is_agent_v<Tn> && ...)
template<typename... Tn>
requires (is_agent_v<Tn> && ...)
void dsm::Dynamics< Id, Size, Delay >::addAgents ( Tn... agents)

Add a pack of agents to the simulation.

Parameters
agentsParameter pack of agents

◆ addAgentsUniformly()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addAgentsUniformly ( Size nAgents,
std::optional< Id > itineraryId = std::nullopt )
virtual

Add a set of agents to the simulation.

Parameters
nAgentsThe number of agents to add
uniformlyIf true, the agents are added uniformly on the streets
Exceptions
std::runtime_errorIf there are no itineraries

◆ addItineraries() [1/2]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addItineraries ( std::span< Itinerary< Id > > itineraries)

Add a set of itineraries.

Parameters
itinerariesGeneric container of itineraries, represented by an std::span

◆ addItineraries() [2/2]

template<typename Id , typename Size , typename Delay >
template<typename T1 , typename... Tn>
requires (is_itinerary_v<T1> && (is_itinerary_v<Tn> && ...))
void dsm::Dynamics< Id, Size, Delay >::addItineraries ( T1 itinerary,
Tn... itineraries )

Add a pack of itineraries.

Template Parameters
T1
...Tn
Parameters
itinerary
...itineraries

◆ addItinerary() [1/2]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addItinerary ( const Itinerary< Id > & itinerary)

Add an itinerary.

Parameters
itineraryThe itinerary

◆ addItinerary() [2/2]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::addItinerary ( std::unique_ptr< Itinerary< Id > > itinerary)

Add an itinerary.

Parameters
itinerarystd::unique_ptr to the itinerary

◆ agentMeanSpeed()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::agentMeanSpeed ( ) const

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

Returns
Measurement<double> The mean speed of the agents and the standard deviation

◆ agents()

template<typename Id , typename Size , typename Delay >
const std::map< Id, std::unique_ptr< Agent< Id, Size, Delay > > > & dsm::Dynamics< Id, Size, Delay >::agents ( ) const
inline

Get the agents.

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

◆ evolve() [1/2]

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::evolve ( bool reinsert_agents = false)
virtual

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

◆ evolve() [2/2]

template<typename Id , typename Size , typename Delay >
template<typename F , typename... Tn>
requires std::is_invocable_v<F, Tn...>
void dsm::Dynamics< Id, Size, Delay >::evolve ( F f,
Tn... args )

Evolve the simulation.

Template Parameters
FThe type of the function to call
...TnThe types of the arguments of the function
Parameters
fThe function to call
...argsThe arguments of the function

◆ graph()

template<typename Id , typename Size , typename Delay >
const Graph< Id, Size > & dsm::Dynamics< Id, Size, Delay >::graph ( ) const
inline

Get the graph.

Returns
const Graph<Id, Size>&, The graph

◆ itineraries()

template<typename Id , typename Size , typename Delay >
const std::unordered_map< Id, std::unique_ptr< Itinerary< Id > > > & dsm::Dynamics< Id, Size, Delay >::itineraries ( ) const
inline

Get the itineraries.

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

◆ m_evolveAgents()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::m_evolveAgents ( )
protectedvirtual

Evolve the agents.

Puts all new agents on a street, if possible, decrements all delays and increments all travel times.

◆ m_evolveNodes()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::m_evolveNodes ( )
protectedvirtual

Evolve the nodes.

If possible, removes all agents from each node, putting them on the next street. If the error probability is not zero, the agents can move to a random street.

◆ m_evolveStreets()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::m_evolveStreets ( bool reinsert_agents)
protectedvirtual

Evolve the streets.

Parameters
reinsert_agentsIf true, the agents are reinserted in the simulation after they reach their destination

If possible, removes the first agent of each street queue, putting it in the destination node. If the agent is going into the destination node, it is removed from the simulation (and then reinserted if reinsert_agents is true)

◆ m_nextStreetId()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Id dsm::Dynamics< Id, Size, Delay >::m_nextStreetId ( Id agentId,
Id NodeId,
std::optional< Id > streetId = std::nullopt )
protectedvirtual

Get the next street id.

Parameters
agentIdThe id of the agent
NodeIdThe id of the node
streetIdThe id of the incoming street
Returns
Id The id of the randomly selected next street

◆ m_updatePath()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::m_updatePath ( const std::unique_ptr< Itinerary< Id > > & pItinerary)
protected

Update the path of a single itinerary.

Parameters
pItineraryAn std::unique_prt to the itinerary

◆ meanSpireInputFlow()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::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 Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::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

◆ meanTravelTime()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::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

◆ optimizeTrafficLights()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::optimizeTrafficLights ( double percentage,
double threshold = 0. )

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

Parameters
percentagedouble, The percentage of the TOTAL cycle time to add or subtract to the green time
thresholddouble, The percentage of the mean capacity of the streets used as threshold for the delta between the two tails.

The function cycles over the traffic lights and, if the difference between the two tails is greater than the threshold multiplied by the mean capacity of the streets, it changes the green and red times of the traffic light, keeping the total cycle time constant.

◆ removeAgent()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::removeAgent ( Size agentId)

Remove an agent from the simulation.

Parameters
agentIdthe id of the agent to remove

◆ setAgentSpeed()

template<typename Id , typename Size , typename Delay >
virtual void dsm::Dynamics< Id, Size, Delay >::setAgentSpeed ( Size agentId)
pure virtual

Set the speed of an agent.

This is a pure-virtual function, it must be implemented in the derived classes

Parameters
agentIdThe id of the agent

Implemented in dsm::FirstOrderDynamics< Id, Size, Delay >, and dsm::SecondOrderDynamics< Id, Size >.

◆ setErrorProbability()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::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 Id , typename Size , typename Delay >
void dsm::Dynamics< Id, Size, Delay >::setForcePriorities ( bool forcePriorities)
inline

Set the force priorities flag.

Parameters
forcePrioritiesThe flag

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

◆ setItineraries()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::setItineraries ( std::span< Itinerary< Id > > itineraries)

Set the itineraries.

Parameters
itinerariesThe itineraries

◆ setMaxFlowPercentage()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::setMaxFlowPercentage ( double maxFlowPercentage)

Set the maximum flow percentage.

Parameters
maxFlowPercentageThe maximum flow percentage

The maximum flow percentage is the percentage of the maximum flow that a street can transmit. Default is 1 (100%).

Exceptions
std::invalid_argumentIf the maximum flow percentage is not between 0 and 1

◆ setMinSpeedRateo()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
void dsm::Dynamics< Id, Size, Delay >::setMinSpeedRateo ( double minSpeedRateo)

Set the minim speed rateo, i.e. the minim speed with respect to the speed limit.

Parameters
minSpeedRateoThe minim speed rateo
Exceptions
std::invalid_argumentIf the minim speed rateo is not between 0 and 1

◆ setSeed()

template<typename Id , typename Size , typename Delay >
void dsm::Dynamics< Id, Size, Delay >::setSeed ( unsigned int seed)
inline

Set the seed for the graph's random number generator.

Parameters
seedThe seed

◆ streetMeanDensity()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::streetMeanDensity ( ) 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 Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::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 Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
Measurement< double > dsm::Dynamics< Id, Size, Delay >::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 Id , typename Size , typename Delay >
virtual Measurement< double > dsm::Dynamics< Id, Size, Delay >::streetMeanSpeed ( ) const
pure virtual

◆ streetMeanSpeed() [2/3]

template<typename Id , typename Size , typename Delay >
virtual Measurement< double > dsm::Dynamics< Id, Size, Delay >::streetMeanSpeed ( double ,
bool  ) const
pure virtual

◆ streetMeanSpeed() [3/3]

template<typename Id , typename Size , typename Delay >
virtual double dsm::Dynamics< Id, Size, Delay >::streetMeanSpeed ( Id ) const
pure virtual

◆ time()

template<typename Id , typename Size , typename Delay >
TimePoint dsm::Dynamics< Id, Size, Delay >::time ( ) const
inline

Get the time.

Returns
TimePoint The time

◆ turnCounts()

template<typename Id , typename Size , typename Delay >
const std::unordered_map< Id, std::array< unsigned long long, 4 > > & dsm::Dynamics< Id, Size, Delay >::turnCounts ( ) const
inline

Get the turn counts of the agents.

Returns
const std::array<unsigned long long, 3>& The turn counts

The array contains the counts of left (0), straight (1), right (2) and U (3) turns

◆ turnProbabilities()

template<typename Id , typename Size , typename Delay >
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size> && is_numeric_v<Delay>)
std::unordered_map< Id, std::array< double, 4 > > dsm::Dynamics< Id, Size, Delay >::turnProbabilities ( bool reset = true)

Get the turn probabilities of the agents.

Returns
std::array<double, 3> The turn probabilities

The array contains the probabilities of left (0), straight (1), right (2) and U (3) turns


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