Individual class.
More...
#include <individual.hpp>
|
| Individual ()=delete |
| Alias.
|
|
| Individual (bool is_male) noexcept |
| for initial population
|
|
| Individual (const std::shared_ptr< Individual > &father, const std::shared_ptr< Individual > &mother, int_fast32_t year, bool is_male) noexcept |
| for sexual reproduction
|
|
| Individual (const Individual &)=delete |
|
double | death_rate (const int_fast32_t year, const int_fast32_t season) const |
| Finite death rate per quarter year: \( d = 1 - \exp(- M - eF) \).
|
|
uint_fast32_t | migrate (uint_fast32_t loc, int_fast32_t year, URBG &) |
| Generate random number for new location.
|
|
void | trace_back (std::ostream &ost, std::unordered_map< const Individual *, uint_fast32_t > *ids, uint_fast32_t loc, int_fast32_t year) const |
| Write ancestors recursively.
|
|
std::ostream & | write (std::ostream &) const |
| Write all the data members in TSV.
|
|
std::ostream & | write (std::ostream &, const std::unordered_map< const Individual *, uint_fast32_t > &) const |
| Write all the data members in TSV with translated IDs.
|
|
|
int_fast32_t | age (const int_fast32_t year) const noexcept |
| Age in the given year.
|
|
double | weight (int_fast32_t year) const noexcept |
| Weight for year age.
|
|
bool | is_male () const noexcept |
| Just returns is_male_.
|
|
|
static std::ostream & | write_trace_back_header (std::ostream &) |
| Write column names for trace_back()
|
|
static std::ostream & | write_names (std::ostream &) |
| Write column names for write()
|
|
static void | set_dependent_static (const uint_fast32_t years) |
| Set static variables that depend on others.
|
|
static bool | is_ready (const uint_fast32_t years) |
| Test if static variables are ready.
|
|
static double | DEATH_RATE (const int_fast32_t q_age, const int_fast32_t year) |
| Finite death rate per quarter year.
|
|
|
static constexpr int_fast32_t | MAX_AGE = 80 |
| No individual lives longer than this.
|
|
static IndividualJson | JSON |
| Parameters shared among instances (JSON file).
|
|
|
using | PairDestDist = std::pair<int_fast32_t, std::discrete_distribution<uint_fast32_t>> |
| Alias for readability.
|
|
|
static void | set_static_migration () |
| Prepare MIGRATION_DESTINATION_.
|
|
static void | set_static_mortality () |
| Prepare mortality vectors.
|
|
static void | set_static_weight () |
| Prepare WEIGHT_FOR_AGE_.
|
|
|
const std::shared_ptr< Individual > | father_ = nullptr |
| Pointer to father.
|
|
const std::shared_ptr< Individual > | mother_ = nullptr |
| Pointer to mother.
|
|
int_fast32_t | birth_year_ = -4 |
| Year of birth.
|
|
const bool | is_male_ |
| Sex.
|
|
|
static std::vector< double > | FISHING_COEF_ |
| Fluctuation of fishing mortality by year.
|
|
static std::vector< double > | WEIGHT_FOR_AGE_ |
| year version of IndividualJson::weight_for_age
|
|
static std::vector< std::vector< PairDestDist > > | MIGRATION_DESTINATION_ |
| Discrete distributions for migration.
|
|
The documentation for this class was generated from the following files: