An agent's state.
More...
#include <state.hh>
|
| AgentState () |
| Default constructor with zero-initialized members. More...
|
|
template<typename RNGType > |
| AgentState (const Config &cfg, const std::shared_ptr< RNGType > &rng) |
| Constructor with config node and RNG. More...
|
|
auto | get_speed () const |
| Returns the current speed of this agent. More...
|
|
auto | get_orientation () const |
| Returns the current orientation in radians, [-π, +π) More...
|
|
const auto & | get_displacement () const |
| The current value of the displacement vector. More...
|
|
auto | set_speed (double new_speed) |
| Sets the speed and subsequently updates the displacement vector. More...
|
|
auto | set_orientation (double new_orientation) |
| Sets the orientation and subsequently updates the displacement vector. More...
|
|
◆ AgentState() [1/2]
Utopia::Models::SimpleFlocking::AgentState::AgentState |
( |
| ) |
|
|
inline |
Default constructor with zero-initialized members.
◆ AgentState() [2/2]
template<typename RNGType >
Utopia::Models::SimpleFlocking::AgentState::AgentState |
( |
const Config & |
cfg, |
|
|
const std::shared_ptr< RNGType > & |
rng |
|
) |
| |
|
inline |
Constructor with config node and RNG.
◆ get_displacement()
const auto& Utopia::Models::SimpleFlocking::AgentState::get_displacement |
( |
| ) |
const |
|
inline |
The current value of the displacement vector.
◆ get_orientation()
auto Utopia::Models::SimpleFlocking::AgentState::get_orientation |
( |
| ) |
const |
|
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.
◆ get_speed()
auto Utopia::Models::SimpleFlocking::AgentState::get_speed |
( |
| ) |
const |
|
inline |
Returns the current speed of this agent.
◆ set_orientation()
auto Utopia::Models::SimpleFlocking::AgentState::set_orientation |
( |
double |
new_orientation | ) |
|
|
inline |
Sets the orientation and subsequently updates the displacement vector.
This also makes sure the new orientation is within a valid range
◆ set_speed()
auto Utopia::Models::SimpleFlocking::AgentState::set_speed |
( |
double |
new_speed | ) |
|
|
inline |
Sets the speed and subsequently updates the displacement vector.
◆ update_displacement()
void Utopia::Models::SimpleFlocking::AgentState::update_displacement |
( |
| ) |
|
|
inlineprotected |
Updates the displacement vector using current speed and orientation.
◆ displacement
SpaceVecType<2> Utopia::Models::SimpleFlocking::AgentState::displacement |
|
private |
The current displacement vector, updated upon any changes.
◆ orientation
double Utopia::Models::SimpleFlocking::AgentState::orientation |
|
private |
Orientation in radians, [-π, +π)
Orientation zero points in positive x direction while ±π/2 points in ±y direction.
◆ speed
double Utopia::Models::SimpleFlocking::AgentState::speed |
|
private |
The documentation for this class was generated from the following file:
- src/utopia/models/SimpleFlocking/state.hh