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
14
16
17 private:
18
19 // number of age groups for each time step, ideally matching the number of workers
20 int numAgeGroups;
21
22 // number of workers 0...numWorkers-1
23 int numWorkers;
24
25 // total number of time steps across all cohorts
26 int numTimeSteps;
27
28 // number of cohorts
29 int numCohorts = this->numAgeGroups + this->numTimeSteps - 1;
30
31 // assign cohort Ids to workers
32 std::map<int, std::vector<int> > worker2cohort;
33
34 // map age index to worker ID
35 std::map<int, int> ageIndex2Worker;
36
37 public:
38
46 SeapodymCohortManager(int numAgeGroups, int numWorkers, int numTimeSteps);
47
53 std::vector<int> getInitCohortIds(int workerId) const;
54
60 int getNumSteps(int cohortId) const;
61
67 std::set<int> getDependencies(int cohortId) const;
68
74 int getNextCohort(int cohortId) const;
75
81 int getNewCohortWorker(int timeStep) const;
82
83};
84
85#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