seapodym-parallel
Fish dynamics models with parameter estimations
Loading...
Searching...
No Matches
SeapodymCohortFake.h
Go to the documentation of this file.
1#include <string>
2#include <vector>
3#include <admodel.h>
4#include "SeapodymCohortAbstract.h"
5
6
7#ifndef SEAPODYM_COHORT_FAKE
8#define SEAPODYM_COHORT_FAKE
9
18
19 private:
20
21 // how long a forward step takes in milliseconds
22 long long milliseconds_step;
23
24 // unique Id for this cohort
25 int id;
26
27 // data to exchange with other cohorts
28 std::vector<double> data;
29
30 public:
31
37 SeapodymCohortFake(int milliseconds_step, std::size_t data_size, int id) : milliseconds_step(milliseconds_step), id(id) {
38 this->data.resize(data_size);
39 }
40
46 SeapodymCohortFake(const std::string& parFile, int id);
47
52
53 SeapodymCohortFake(const std::string& restartFile);
54
60 SeapodymCohortFake(const std::vector<double>& data, int id);
61
66 void stepForward(const dvar_vector& paramVector);
67
72 void setStateFromArray(const std::vector<double>& array);
73
78 std::vector<double> getArrayFromState() const;
79
84 void save(const std::string& restartFile) const;
85
86};
87
88#endif // SEAPODYM_COHORT_FAKE
Abstract class for a cohort object. Specific implementation must derive from this class and override ...
Definition SeapodymCohortAbstract.h:13
std::vector< double > getArrayFromState() const
Serialize the state.
Definition SeapodymCohortFake.cpp:40
void setStateFromArray(const std::vector< double > &array)
Definition SeapodymCohortFake.cpp:35
void save(const std::string &restartFile) const
Save the current state to a file.
Definition SeapodymCohortFake.cpp:46
void stepForward(const dvar_vector &paramVector)
Step forward.
Definition SeapodymCohortFake.cpp:30
SeapodymCohortFake(int milliseconds_step, std::size_t data_size, int id)
Constructor.
Definition SeapodymCohortFake.h:37