1#ifndef FISH_POPULATION_H
2#define FISH_POPULATION_H
11#include "CEnvironment.h"
12#include "IBasicBottom.h"
13#include "ICurrentVel.h"
14#include "sfh/timers/ProfilerWallclock.h"
15#include "sfh/math/math.h"
17#include "IndividualFish.h"
18#include "particles/PelletField.h"
19#include "fish/FishParameters.h"
20#include "environment/ArtificialLightSource.h"
21#include "fish/Z_Tree.h"
22#include <CIntegratorOptions.h>
24#include "fish/FishCage.h"
25#include <CPrintDuringExec.h>
30#ifdef FH_VISUALIZATION
82 virtual void OdeFcn(
const double T,
const double *
const X,
double *
const XDot,
const bool isMajorTimeStep);
83 virtual void InitialConditionSetup(
const double T,
const double *
const currentIC,
double *
const updatedIC, ISimObjectCreator *
const creator);
84 virtual void FinalSetup(
const double T,
const double *
const X, ISimObjectCreator *
const creator);
86 void PreOdeFcn(
const double T,
const double *
const X, IStateUpdater* updater);
89 bool GetRayIntersection(
const Eigen::Vector3d& rayOrigin,
const Eigen::Vector3d& rayVector,
double& outDistance);
92 const virtual double* DragForceNet(
const double T,
const double *
const X);
93 const virtual double* DragForceSkirt(
const double T,
const double *
const X);
94 const virtual double* DragForceDepth(
const double T,
const double *
const X);
95 const virtual double* TopOutForceNet(
const double T,
const double*
const X,
int iTop);
96 const virtual double* BotOutPosition(
const double T,
const double*
const X);
97 const virtual double* RingOutPosition(
const double T,
const double*
const X);
98 const virtual double* NetOutPosition(
const double T,
const double*
const X);
99 const virtual double* NetOutPositionMat(
const double T,
const double*
const X,
int iIndex);
100 const virtual double* IngestionNumber(
const double T,
const double*
const X);
101 const virtual double* ObstacleOutPosition(
const double T,
const double*
const X);
102 const virtual double* ObstacleOutNormal(
const double T,
const double*
const X);
103 const virtual double* ObstacleOutDistance(
const double T,
const double*
const X);
104 const virtual double* ObstacleOutGuidance(
const double T,
const double*
const X);
105 const virtual double* ObstacleOutEtaReference(
const double T,
const double*
const X);
106 const virtual double* ObstacleOutVelocity(
const double T,
const double*
const X);
107 const virtual double* ObstacleOutVertical(
const double T,
const double*
const X);
108 const virtual double* TopBodyForce(
const double T,
const double *
const X);
109 const virtual double* PortOutForceNet(
const double T,
const double*
const X,
int iCon);
110 const virtual double* PortOutPositionNet(
const double T,
const double*
const X,
int iCon);
111 const virtual double* PortOutVelocityNet(
const double T,
const double*
const X,
int iCon);
112 const virtual double* PortOutCageVolume(
const double T,
const double*
const X);
113 const virtual double* PortOutCD(
const double T,
const double*
const X,
int iCon);
114 const virtual double* BotOutVelocity(
const double T,
const double*
const X);
115 const virtual double* CageTopCentre(
const double T,
const double*
const X);
116 const virtual double* FishDensity(
const double T,
const double*
const X);
117 const virtual double* FishSpeed(
const double T,
const double*
const X);
118 const virtual double* FishSpeedRel(
const double T,
const double*
const X);
119 const virtual double* RingOutForce(
const double T,
const double*
const X,
int iIndex);
120 const virtual double* NetTrackOutPosition(
const double T,
const double*
const X);
121 const virtual double* ChainOutForce(
const double T,
const double*
const X,
int iIndex);
122 const virtual double* OutCageWakePos(
const double T,
const double*
const X);
127 double m_ncOutput[3];
128 const virtual double* NetCDFOutput(
const double T,
const double*
const X);
132#ifdef FH_VISUALIZATION
134 virtual void RenderInit(Ogre::Root *
const ogreRoot, ISimObjectCreator *
const creator);
136 virtual void RenderUpdate(
const double T,
const double *
const X);
141 CPrintDuringExec* m_logger;
146 int m_baseStateIndex;
147 int m_totalNumberOfPelletsEaten;
154 std::vector<Fish::IndividualFish> m_individuals;
155 std::vector<Fish::IndividualFish> temp_individuals;
159 bool m_useTemperatureAndLight;
160 double m_fractionOfWaveVelAddedToMovementAsBias;
163 long m_totalIngestionAttempts, m_successfulIngestionAttempts;
164 std::vector<int> m_ingestionList;
167 double m_DisOutTimeInt;
168 std::string m_DisOutFile;
170 double m_DisOutStart;
173 double m_IngestionNumber[2];
176 double m_ObstacleCirRate;
177 double m_ObstacleCirVel;
178 double m_ObstacleVerVel[2];
179 double m_ObstacleDisTK;
180 double m_ObstacleDepTK;
181 double m_ObstacleDepGR;
182 double m_ObstacleRefDT;
183 ISignalPort* m_ObstacleInPos;
184 ISignalPort* m_ObstacleInVel;
185 double m_ObstacleOutP[3];
186 double m_ObstacleOutN[3];
187 double m_ObstacleOutD;
188 double m_ObstacleOutG[3];
189 double m_ObstacleOutV[3];
190 double m_ObstacleOutVV[3];
191 double m_ObstacleOutGR[4];
194 Fish::vec3 m_FishObstVel;
196 double m_UpdateStepSize;
199 double m_FishInitialPos[4];
201 std::vector<int> m_FishID;
203 double m_SchoolVar[2];
204 Fish::vec3 m_SchoolVarP;
205 Fish::vec3 m_SchoolVarN;
207 bool m_BoolFishInVel;
208 ISignalPort* m_FishInVelN;
209 ISignalPort* m_FishInVelE;
210 ISignalPort* m_FishInVelD;
211 ISignalPort* m_FishInVelC;
213 bool m_BoolFishInWave;
214 ISignalPort* m_FishInWaveHm;
215 ISignalPort* m_FishInWaveTm;
217 double m_OutFishDensityGrid;
219 double* m_OutFishDensityData;
220 double m_OutFishDensity[4];
221 double m_OutFishSpeed[3];
222 double m_OutFishSpeedRel[3];
228 double* m_OutCageNodePos;
229 const virtual double* PortOutCageNodePos(
const double T,
const double*
const X,
int index);
231 double m_CageWakePos[3];
235 double m_prev_time = 0.0;
240#ifdef FH_VISUALIZATION
241 bool m_advancedFishAnim;
242 Ogre::SceneNode* m_childNode;
243 Ogre::ManualObject* m_fishRenderObj;
244 CFhCamera* m_FhCamera;
245 double m_FishColor[3];
248 double m_ParticleGridOrigin[3];
249 double m_ParticleGridDim[3];
250 double m_ParticleGridSize[3];
251 int m_ParticleGridNum[3];
254 Ogre::ParticleSystem* m_ParticleSystem;
255 Ogre::SceneNode* m_ParticleNode;
256 Ogre::ParticleEmitter* m_ParticleEmitter;
257 double m_ParticleSize[2];
258 double m_ParticleMultiplier;
259 double m_ParticleSpeedMultiplier;
260 double m_ParticleFadeRate;
262 double m_ParticleAngleSpread;
263 double m_ParticleColor[3];
264 double m_ParticleTimeToLive;
265 int m_ParticleSetTime;
266 double m_ParticleFlowReduction;
271 ISignalPort** m_wakeObjPort;
272 ISignalPort* m_wakeDirPort;
273 ISignalPort* m_wakeRatioPort;
274 ISignalPort* m_wakeValuePort;
275 double m_wakeObjRadius[3];
276 double m_wakeObjDepth[3];
277 double m_wakeMaxVisValue;
278 bool m_wakeVisReduction;
279 double m_wakeObjPower;
280 double GetWakeRatio(
const double T,
const double*
const X,
const double adPos[3]);
Definition: FishPopulation.h:76
FishPopulation(std::string simObjectName, ISimObjectCreator *creator)
The constructor sets the pointer to the output object and the parser object.
virtual ~FishPopulation()
The destructor deletes dynamically allocated memory.
Definition: IndividualFish.h:30