Program Listing for File wander_force.hpp

Return to documentation for file (cosm/apf2D/nav/wander_force.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include <memory>

#include "rcppsw/math/radians.hpp"
#include "rcppsw/math/rng.hpp"
#include "rcppsw/rcppsw.hpp"

#include "cosm/apf2D/nav/base_bias_angle_generator.hpp"
#include "cosm/apf2D/boid.hpp"
#include "cosm/apf2D/nav/config/wander_force_config.hpp"
#include "cosm/apf2D/base_force.hpp"

/*******************************************************************************
 * Namespaces/Decls
 ******************************************************************************/
namespace cosm::apf2D::nav {

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class wander_force : capf2D::base_force {
 public:
  explicit wander_force(const config::wander_force_config* config);

  rmath::vector2d operator()(const boid& entity, rmath::rng* rng);

 private:
  /* clang-format off */
  const config::wander_force_config          mc_config;

  int                                        m_count{-1};
  rmath::radians                             m_last_angle{0.001};
  rmath::radians                             m_angle{0};
  std::unique_ptr<base_bias_angle_generator> m_bias_generator;
  /* clang-format on */
};

} /* namespace cosm::apf2D::nav */