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 "CEnvironment.h"
13#include <CPrintDuringExec.h>
15#include "compact_data_representations.h"
19#include <CPrintDuringExec.h>
20#include <CEnvironment.h>
22#include "FishParameters.h"
23#include "eigen_matrix_defs.h"
24#include "../particles/PelletField.h"
25#include "../environment/VerticalAbioticEnvironment.h"
38 std::vector<Fish::IndividualFish>* m_individuals;
39 int m_base_state_index;
40 bool m_surfRespActive;
41 bool m_wallRespActive;
42 bool m_feedRespActive;
43 bool m_tempRespActive;
44 bool m_lightRespActive;
46 bool m_stochRespActive;
47 bool m_wvelRespActive;
51 double m_ObstaclePrefDis;
52 Fish::vec3 m_ObstaclePos;
53 Fish::vec3 m_ObstacleVel;
102 static const int g_NumStatesPerFish = 10;
108 void Init(
FishResources *fishResources, std::mt19937& rng,
const double* states);
110 void calculateDerivative(
113 const double*
const X,
116 std::vector<int>& ingestionList,
124 vec3 Velocity(){
return m_Velocity;}
125 double BodyLength(){
return m_Length;}
126 double CharacteristicVelocity(){
return m_characteristicVelocityFactor;}
129 char BehaviouralState(){
return m_behaviouralState;}
130 void UpdateStates(
const double* states);
131 void WriteStates(
double* states);
135 inline static double forward_scanning_distance(
const vec3& P0,
const vec3& V0,
const vec3& P1,
const vec3& V1) {
138 double d = dP.norm();
139 double x = dP.dot(dV);
140 return d + x/(x*x+1.0);
146 vec3 VelocityRel() {
return m_VelocityRel;}
147 double GetDEBG0() {
return m_debG0;}
148 double GetDEBE0() {
return m_debE0;}
149 double GetDEBV0() {
return m_debV0;}
153#ifdef FH_VISUALIZATION
154 Eigen::Vector3f Color();
155 Eigen::Vector3f m_rgb;
161 behaviour_vote(
const vec3& d,
double g){direction = d; vote_gain = g;}
171 behaviour_vote feed_behaviour(
const double T,
const double*
const X, std::mt19937& rng);
214 char m_behaviouralState;
Definition: CEnvironment.h:10
Definition: DebModel.h:61
Definition: FishCage.h:17
Definition: FishParameters.h:30
Definition: IndividualFish.h:105
float m_startTimeManipulation
Last timestamp at which the fish evaluated whether it experiences satiation or hunger.
Definition: IndividualFish.h:204
vec3 m_Position
Timestamp at which the fish commenced present feed manipulation.
Definition: IndividualFish.h:207
float m_lastEvaluationOfSatiation
pointer to all common resources, f.i. DebModel, FishParameters, RNG, etc.
Definition: IndividualFish.h:203
Definition: PelletField.h:48
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:30
PelletField * m_pellets
Contains all parameters or factors required to compute parameters.
Definition: IndividualFish.h:33
Definition: IndividualFish.h:159