1#ifndef UTOPIA_MODELS_SIMPLEFLOCKING_STATE_HH
2#define UTOPIA_MODELS_SIMPLEFLOCKING_STATE_HH
38 template<
typename RNGType>
An agent's state.
Definition state.hh:15
auto get_speed() const
Returns the current speed of this agent.
Definition state.hh:51
auto get_orientation() const
Returns the current orientation in radians, [-π, +π)
Definition state.hh:59
SpaceVecType< 2 > displacement
The current displacement vector, updated upon any changes.
Definition state.hh:26
double orientation
Orientation in radians, [-π, +π)
Definition state.hh:23
void update_displacement()
Updates the displacement vector using current speed and orientation.
Definition state.hh:88
double speed
Agent speed.
Definition state.hh:17
AgentState(const Config &cfg, const std::shared_ptr< RNGType > &rng)
Constructor with config node and RNG.
Definition state.hh:39
AgentState()
Default constructor with zero-initialized members.
Definition state.hh:30
auto set_orientation(double new_orientation)
Sets the orientation and subsequently updates the displacement vector.
Definition state.hh:79
auto set_speed(double new_speed)
Sets the speed and subsequently updates the displacement vector.
Definition state.hh:71
const auto & get_displacement() const
The current value of the displacement vector.
Definition state.hh:64
ReturnType get_as(const std::string &key, const DataIO::Config &node)
This function is a wrapper around the yaml-cpp YAML::Node::as function.
Definition cfg_utils.hh:158
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
Definition SimpleFlocking.hh:15
T random_angle(const std::shared_ptr< RNG > &rng)
Returns a uniformly random angle value in [-π, +π)
Definition utils.hh:26
T constrain_angle(T angle)
Constrains an angle value to interval [-π, +π)
Definition utils.hh:32
DataIO::Config Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition types.hh:80
arma::Col< double >::fixed< dim > SpaceVecType
Type for vector-like data that is associated with a physical space.
Definition types.hh:61