-
Notifications
You must be signed in to change notification settings - Fork 0
/
rummy_simulation.hpp
executable file
·50 lines (36 loc) · 1.3 KB
/
rummy_simulation.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef RUMMY_SIMULATION_HPP
#define RUMMY_SIMULATION_HPP
#include "rummy_individual.hpp"
#include <simulation/simulation.hpp>
#include <Eigen/Core>
namespace simu {
namespace simulation {
namespace defaults {
struct RummySimuParams : public Settings {
int num_fish = 2;
float radius = 25.;
};
} // namespace defaults
class RummySimulation : public Simulation {
public:
RummySimulation(defaults::RummySimuParams params = defaults::RummySimuParams());
virtual void spin_once() override;
std::vector<RummyIndividualPtr> fish() const;
std::vector<RummyIndividualPtr>& fish();
int next_kicker_idx() const;
float t_next_kick() const;
bool is_kicking() const;
const defaults::RummySimuParams params() const;
defaults::RummySimuParams& params();
void reinit();
protected:
defaults::RummySimuParams _params;
std::vector<RummyIndividualPtr> _fish;
int _next_kicker_idx;
float _t_next_kick;
bool _is_kicking;
};
using FishSimulationPtr = std::shared_ptr<RummySimulation>;
} // namespace simulation
} // namespace simu
#endif