seapodym-parallel
Fish dynamics models with parameter estimations
Loading...
Searching...
No Matches
SeapodymCohortManager.h
1#include <map>
2#include <vector>
3#include <set>
4
5#ifndef SEAPODYM_COHORT_MANAGER
6#define SEAPODYM_COHORT_MANAGER
7
13
15
16 private:
17
18 // number of age groups for each time step, ideally matching the number of workers
19 int numAgeGroups;
20
21 // number of workers 0...numWorkers-1
22 int numWorkers;
23
24 // total number of time steps across all cohorts
25 int numTimeSteps;
26
27 // number of cohorts
28 int numCohorts = this->numAgeGroups + this->numTimeSteps - 1;
29
30 // assign cohort Ids to workers
31 std::map<int, std::vector<int> > worker2cohort;
32
33 // map age index to worker ID
34 std::map<int, int> ageIndex2Worker;
35
36 public:
37
45 SeapodymCohortManager(int numAgeGroups, int numWorkers, int numTimeSteps);
46
52 std::vector<int> getInitCohortIds(int workerId) const;
53
59 int getNumSteps(int cohortId) const;
60
66 std::set<int> getDependencies(int cohortId) const;
67
73 int getNextCohort(int cohortId) const;
74
80 int getNewCohortWorker(int timeStep) const;
81
82};
83
84#endif // SEAPODYM_COHORT_MANAGER
SeapodymCohortManager(int numAgeGroups, int numWorkers, int numTimeSteps)
Definition SeapodymCohortManager.cpp:5
int getNextCohort(int cohortId) const
Definition SeapodymCohortManager.cpp:77
std::vector< int > getInitCohortIds(int workerId) const
Definition SeapodymCohortManager.cpp:28
std::set< int > getDependencies(int cohortId) const
Definition SeapodymCohortManager.cpp:49
int getNumSteps(int cohortId) const
Definition SeapodymCohortManager.cpp:34
int getNewCohortWorker(int timeStep) const
Definition SeapodymCohortManager.cpp:92