Dynamical system model
|
The Agent class represents an agent in the network. More...
#include <Agent.hpp>
Public Member Functions | |
Agent (Id id, Id itineraryId) | |
Construct a new Agent object. | |
Agent (Id id, Id itineraryId, Id srcNodeId) | |
Construct a new Agent object. | |
void | setStreetId (Id streetId) |
Set the street occupied by the agent. | |
void | setSourceNodeId (Id srcNodeId) |
Set the source node id of the agent. | |
void | setItineraryId (Id itineraryId) |
Set the agent's itinerary. | |
void | setSpeed (double speed) |
Set the agent's speed. | |
void | incrementDelay () |
Increment the agent's delay by 1. | |
void | incrementDelay (Delay delay) |
Set the agent's delay. | |
void | decrementDelay () |
Decrement the agent's delay by 1. | |
void | incrementDistance () |
Increment the agent's distance by its speed * 1 second. | |
void | incrementDistance (double distance) |
Increment the agent's distance by a given value. | |
void | incrementTime () |
Increment the agent's time by 1. | |
void | incrementTime (unsigned int time) |
Increment the agent's time by a given value. | |
void | resetTime () |
Reset the agent's time to 0. | |
Id | id () const |
Get the agent's id. | |
Id | itineraryId () const |
Get the agent's itinerary. | |
std::optional< Id > | streetId () const |
Get the id of the street currently occupied by the agent. | |
std::optional< Id > | srcNodeId () const |
Get the id of the source node of the agent. | |
double | speed () const |
Get the agent's speed. | |
Delay | delay () const |
Get the agent's delay. | |
double | distance () const |
Get the agent's travelled distance. | |
unsigned int | time () const |
Get the agent's travel time. | |
The Agent class represents an agent in the network.
Id,The | type of the agent's id. It must be an unsigned integral type. |
Size,The | type of the size of a street. It must be an unsigned integral type. |
Delay,The | type of the agent's delay. It must be a numeric type (see utility/TypeTraits/is_numeric.hpp). |
dsm::Agent< Delay >::Agent | ( | Id | id, |
Id | itineraryId ) |
Construct a new Agent object.
id | The agent's id |
itineraryId | The agent's itinerary |
dsm::Agent< Delay >::Agent | ( | Id | id, |
Id | itineraryId, | ||
Id | srcNodeId ) |
Construct a new Agent object.
id | The agent's id |
itineraryId | The agent's itinerary |
srcNodeId | The id of the source node of the agent |
void dsm::Agent< Delay >::decrementDelay | ( | ) |
Decrement the agent's delay by 1.
std::underflow_error,if | delay has reached its minimum value |
|
inline |
Get the agent's delay.
|
inline |
Get the agent's travelled distance.
|
inline |
Get the agent's id.
void dsm::Agent< Delay >::incrementDelay | ( | ) |
Increment the agent's delay by 1.
std::overflow_error,if | delay has reached its maximum value |
void dsm::Agent< Delay >::incrementDelay | ( | Delay | delay | ) |
Set the agent's delay.
delay | The agent's delay |
std::overflow_error,if | delay has reached its maximum value |
void dsm::Agent< Delay >::incrementDistance | ( | double | distance | ) |
Increment the agent's distance by a given value.
distance | The value to increment the agent's distance byĆ¹ |
std::invalid_argument,if | distance is negative |
void dsm::Agent< Delay >::incrementTime | ( | ) |
Increment the agent's time by 1.
std::overflow_error,if | time has reached its maximum value |
void dsm::Agent< Delay >::incrementTime | ( | unsigned int | time | ) |
Increment the agent's time by a given value.
time | The value to increment the agent's time by |
std::overflow_error,if | time has reached its maximum value |
|
inline |
Get the agent's itinerary.
|
inline |
Set the agent's itinerary.
itineraryId | The agent's itinerary |
|
inline |
Set the source node id of the agent.
srcNodeId | The id of the source node of the agent |
void dsm::Agent< Delay >::setSpeed | ( | double | speed | ) |
Set the agent's speed.
speed,The | agent's speed |
std::invalid_argument,if | speed is negative |
|
inline |
Set the street occupied by the agent.
streetId | The id of the street currently occupied by the agent |
|
inline |
Get the agent's speed.
|
inline |
Get the id of the source node of the agent.
|
inline |
Get the id of the street currently occupied by the agent.
|
inline |
Get the agent's travel time.