Class alignment_force
Defined in File alignment_force.hpp
Inheritance Relationships
Base Type
public rer::client< alignment_force >
Class Documentation
-
class alignment_force : public rer::client<alignment_force>
A force pulling an agent towards a single other agent, or towards the centroid of the positions of a set of agents.
From FLOCK:Bagarti2018-stochfov.
Public Functions
-
rmath::vector2d operator()(const boid &agent, const std::vector<rmath::vector2d> &others) const
Calculate the force.
- Parameters:
agent – The current agent.
neighbors – The velocities of the neighbors of
agent
.
- Returns:
The heading correction the agent should take to stay aligned with the average position of
neighbors
.
-
rmath::vector2d operator()(const boid &agent, const std::vector<rmath::vector2d> &others) const