Utopia 2
Framework for studying models of complex & adaptive systems.
|
An agent's state. More...
#include <state.hh>
Public Member Functions | |
AgentState () | |
Default constructor with zero-initialized members. | |
template<typename RNGType > | |
AgentState (const Config &cfg, const std::shared_ptr< RNGType > &rng) | |
Constructor with config node and RNG. | |
auto | get_speed () const |
Returns the current speed of this agent. | |
auto | get_orientation () const |
Returns the current orientation in radians, [-π, +π) | |
const auto & | get_displacement () const |
The current value of the displacement vector. | |
auto | set_speed (double new_speed) |
Sets the speed and subsequently updates the displacement vector. | |
auto | set_orientation (double new_orientation) |
Sets the orientation and subsequently updates the displacement vector. | |
Protected Member Functions | |
void | update_displacement () |
Updates the displacement vector using current speed and orientation. | |
Private Attributes | |
double | speed |
Agent speed. | |
double | orientation |
Orientation in radians, [-π, +π) | |
SpaceVecType< 2 > | displacement |
The current displacement vector, updated upon any changes. | |
An agent's state.
|
inline |
Default constructor with zero-initialized members.
|
inline |
Constructor with config node and RNG.
The current value of the displacement vector.
|
inline |
Returns the current orientation in radians, [-π, +π)
An orientation value of zero points in positive x direction while a value of ±π/2 points in ±y direction.
|
inline |
Returns the current speed of this agent.
Sets the orientation and subsequently updates the displacement vector.
This also makes sure the new orientation is within a valid range
Sets the speed and subsequently updates the displacement vector.
|
inlineprotected |
Updates the displacement vector using current speed and orientation.
|
private |
The current displacement vector, updated upon any changes.
|
private |
Orientation in radians, [-π, +π)
Orientation zero points in positive x direction while ±π/2 points in ±y direction.