seapodym-parallel
Fish dynamics models with parameter estimations
Loading...
Searching...
No Matches
SeapodymCohortDependencyAnalyzer Class Reference

A class to compute the task dependencies of multiple fish cohort tasks. More...

#include <SeapodymCohortDependencyAnalyzer.h>

Public Member Functions

 SeapodymCohortDependencyAnalyzer (int numAgeGroups, int numTimeSteps)
int getNumberOfCohorts () const
int getNumberOfCohortSteps () const
std::map< int, int > getStepBegMap () const
std::map< int, int > getStepEndMap () const
std::map< int, std::set< std::array< int, 2 > > > getDependencyMap () const

Detailed Description

A class to compute the task dependencies of multiple fish cohort tasks.

A fish cohort is a population of fish that were born in the same interval of time. A task evolves a fish cohort over multiple time steps. After some time steps, the cohort is removed from the population and a new cohort is being born by combining the biomass of the cohorts from the previous time step. For instance, let there be 3 starting age groups (0, 1 and 2) whose populations are modelled over 5 time steps. This can be represented as:

0 1 2
3 1 2
3 4 2
3 4 5
6 4 5

where the numbers are the cohort Ids. The horizontal axis represents the different age groups and the vertical axis is time. A each time step a new cohort is born.

Constructor & Destructor Documentation

◆ SeapodymCohortDependencyAnalyzer()

SeapodymCohortDependencyAnalyzer::SeapodymCohortDependencyAnalyzer ( int numAgeGroups,
int numTimeSteps )

Constructor

Parameters
numAgeGroupsnumber of age groups (e.g. 3 in the above example)
numTimeStepsnumber of tiem steps (e.g. 5 in the above example)

Member Function Documentation

◆ getDependencyMap()

std::map< int, std::set< std::array< int, 2 > > > SeapodymCohortDependencyAnalyzer::getDependencyMap ( ) const

Get the dependency map

In the above example, cohorts 0, 1 and 2 have no dependencies. Cohort 3 depends on cohorts 0, 1, 2 all at step 0; cohort 4 depends on cohort 0 at step 1, cohort 1 at step 1 and cohort 3 at step 0; etc.

Returns
Id: {(Id, step), ...} map

◆ getNumberOfCohorts()

int SeapodymCohortDependencyAnalyzer::getNumberOfCohorts ( ) const

Get the number of cohorts

In the above example, there are 7 cohorts with Ids 0..6

Returns
number

◆ getNumberOfCohortSteps()

int SeapodymCohortDependencyAnalyzer::getNumberOfCohortSteps ( ) const

Get the number of cohort steps

In the above example, there are 5*3 = 15 cohort-steps

Returns
number

◆ getStepBegMap()

std::map< int, int > SeapodymCohortDependencyAnalyzer::getStepBegMap ( ) const

Get the cohort Id: starting index map

In the above example, 0->2, 1->1, 2->0, 3->0...4->0, 5->0, 6->0

Returns
Id to number map

◆ getStepEndMap()

std::map< int, int > SeapodymCohortDependencyAnalyzer::getStepEndMap ( ) const

Get the cohort Id: last index + 1 map

In the above example, 0->3, 1->3, ....4->3, 5->2, 6->1

Returns
Id to number map

The documentation for this class was generated from the following files: