1#ifndef INDIVIDUAL_FISH_H
2#define INDIVIDUAL_FISH_H
4#include "sfh/math/math.h"
5#include "sfh/math/array.h"
8#include "sfh/constants.h"
9#include "sfh/util/diagnostic.h"
11#include "sfh/sim/Quaternion.h"
12#include <CPrintDuringExec.h>
14#include "compact_data_representations.h"
18#include <CPrintDuringExec.h>
19#include <EnvironmentProvider.h>
21#include "FishParameters.h"
22#include "eigen_matrix_defs.h"
23#include "../particles/PelletField.h"
24#include "../environment/VerticalAbioticEnvironment.h"
33 environment::EnvironmentProvider *m_env;
37 std::vector<Fish::IndividualFish>* m_individuals;
38 int m_base_state_index;
39 bool m_surfRespActive;
40 bool m_wallRespActive;
41 bool m_feedRespActive;
42 bool m_tempRespActive;
43 bool m_lightRespActive;
45 bool m_stochRespActive;
46 bool m_wvelRespActive;
50 double m_ObstaclePrefDis;
51 Fish::vec3 m_ObstaclePos;
52 Fish::vec3 m_ObstacleVel;
101 static const int g_NumStatesPerFish = 10;
107 void Init(
FishResources *fishResources, std::mt19937& rng,
const double* states);
109 void calculateDerivative(
112 const double*
const X,
115 std::vector<int>& ingestionList,
123 vec3 Velocity(){
return m_Velocity;}
124 double BodyLength(){
return m_Length;}
125 double CharacteristicVelocity(){
return m_characteristicVelocityFactor;}
128 char BehaviouralState(){
return m_behaviouralState;}
129 void UpdateStates(
const double* states);
130 void WriteStates(
double* states);
134 inline static double forward_scanning_distance(
const vec3& P0,
const vec3& V0,
const vec3& P1,
const vec3& V1) {
137 double d = dP.norm();
138 double x = dP.dot(dV);
139 return d + x/(x*x+1.0);
145 vec3 VelocityRel() {
return m_VelocityRel;}
146 double GetDEBG0() {
return m_debG0;}
147 double GetDEBE0() {
return m_debE0;}
148 double GetDEBV0() {
return m_debV0;}
152#ifdef FH_VISUALIZATION
153 Eigen::Vector3f Color();
154 Eigen::Vector3f m_rgb;
160 behaviour_vote(
const vec3& d,
double g){direction = d; vote_gain = g;}
170 behaviour_vote feed_behaviour(
const double T,
const double*
const X, std::mt19937& rng);
213 char m_behaviouralState;
Definition FishParameters.h:30
Definition IndividualFish.h:104
float m_startTimeManipulation
Last timestamp at which the fish evaluated whether it experiences satiation or hunger.
Definition IndividualFish.h:203
vec3 m_Position
Timestamp at which the fish commenced present feed manipulation.
Definition IndividualFish.h:206
float m_lastEvaluationOfSatiation
pointer to all common resources, f.i. DebModel, FishParameters, RNG, etc.
Definition IndividualFish.h:202
Definition PelletField.h:46
Definition VerticalAbioticEnvironment.h:39
Definition compact_data_representations.h:126
Definition compact_data_representations.h:40
Definition compact_data_representations.h:13
Definition IndividualFish.h:29
PelletField * m_pellets
Contains all parameters or factors required to compute parameters.
Definition IndividualFish.h:32
Definition IndividualFish.h:158