The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
the_hormones Module Reference

Definition the hormonal architecture of the agent. More...

Data Types

type  hormones
 This type adds hormonal architecture extending the genome object. More...
 

Functions/Subroutines

subroutine hormones_init_genotype (this)
 Initialise hormone levels based on the genome value. Two alleles are selected at random and input into the gamma2gene function to get the initial hormone values rescaled to 0:1. Note that the gamma2gene alleles defining the shape of the gamma function and the half-max effect are selected randomly in this version. Also, polyploid organisms are possible, in such case, two parameters are also randomly defined from a larger set (e.g. from four chromosomes in case of tetraploids). See implementation details and comments for each of the hormones. More...
 
elemental subroutine hormones_clean_history_stack (this)
 Clean the history stack of hormones: testosterone and estrogen histories are set to MISSING. More...
 
elemental subroutine hormones_update_history (this)
 Update the sex steroid hormones history stack from the current level. More...
 
elemental real(srp) function hormones_reproductive_factor_calc (this)
 Calculate the reproductive factor. Reproductive factor is defined as the current level of the_hormones::testosterone_level in males and the_hormones::estrogen_level in females. More...
 
elemental real(srp) function testosteron_baseline_get_level (this)
 Get the value of testosterone baseline. More...
 
elemental real(srp) function estrogen_baseline_get_level (this)
 Get the value of estrogen baseline. More...
 
Accessor functions for all the hormones.

Get and set functions for each hormone follow. We left them as individual hormone-specific functions duplicating code. Not ideal, but easy to use provided hormones do not change too often. Tiny atomic hormone get/set functions are easy to code.

elemental real(srp) function growhorm_get_level (this)
 Get the value of growth hormone. More...
 
elemental subroutine growhorm_set_level (this, value_set)
 Set the value of growth hormone. More...
 
elemental real(srp) function thyroid_get_level (this)
 Get the value of thyroid. More...
 
elemental subroutine thyroid_set_level (this, value_set)
 Set the value of thyroid. More...
 
elemental real(srp) function adrenaline_get_level (this)
 Get the value of adrenaline. More...
 
elemental subroutine adrenaline_set_level (this, value_set)
 Set the value of adrenaline. More...
 
elemental real(srp) function cortisol_get_level (this)
 Get the value of cortisol. More...
 
elemental subroutine cortisol_set_level (this, value_set)
 Set the value of cortisol. More...
 
elemental real(srp) function testosterone_get_level (this)
 Get the value of testosterone. More...
 
elemental subroutine testosterone_set_level (this, value_set, update_history)
 Set the value of testosterone. More...
 
elemental real(srp) function estrogen_get_level (this)
 Get the value of estrogen. More...
 
elemental subroutine estrogen_set_level (this, value_set, update_history)
 Set the value of estrogen. More...
 

Variables

character(len= *), parameter, private modname = "(THE_HORMONES)"
 

Detailed Description

Definition the hormonal architecture of the agent.

THE_HORMONES module

Define the hormonal architecture objects. Hormones affect implemented in such a way as to affect decision making and behaviour, but change relatively slowly across the lifespan of the agent. Their initial state is also genetically determined.

Function/Subroutine Documentation

◆ hormones_init_genotype()

subroutine the_hormones::hormones_init_genotype ( class(hormones), intent(inout)  this)

Initialise hormone levels based on the genome value. Two alleles are selected at random and input into the gamma2gene function to get the initial hormone values rescaled to 0:1. Note that the gamma2gene alleles defining the shape of the gamma function and the half-max effect are selected randomly in this version. Also, polyploid organisms are possible, in such case, two parameters are also randomly defined from a larger set (e.g. from four chromosomes in case of tetraploids). See implementation details and comments for each of the hormones.

Implementation details

First, get all the initial hormone level values from the genotype.

Then, initialise the baseline levels of sex steroids from the starting genetically determined hormone levels.

Clean history stack of all the hormones upon init.

Finally, update the hormone history stack with the first init values.

Definition at line 148 of file m_hormon.f90.

◆ hormones_clean_history_stack()

elemental subroutine the_hormones::hormones_clean_history_stack ( class(hormones), intent(inout)  this)

Clean the history stack of hormones: testosterone and estrogen histories are set to MISSING.

Definition at line 195 of file m_hormon.f90.

◆ hormones_update_history()

elemental subroutine the_hormones::hormones_update_history ( class(hormones), intent(inout)  this)

Update the sex steroid hormones history stack from the current level.

Update the hormone history stack with the first init values.

Definition at line 205 of file m_hormon.f90.

◆ hormones_reproductive_factor_calc()

elemental real(srp) function the_hormones::hormones_reproductive_factor_calc ( class(hormones), intent(in)  this)

Calculate the reproductive factor. Reproductive factor is defined as the current level of the_hormones::testosterone_level in males and the_hormones::estrogen_level in females.

Note
Because the reproductive factor is obtained by sex-specific operations directly on the hormones, the use of this function is mostly limited to diagnostic outputs.
Returns
Reproductive factor.

Definition at line 221 of file m_hormon.f90.

◆ growhorm_get_level()

elemental real(srp) function the_hormones::growhorm_get_level ( class(hormones), intent(in)  this)

Get the value of growth hormone.

Returns
value, Returns the value of the growth hormone.

Definition at line 245 of file m_hormon.f90.

◆ growhorm_set_level()

elemental subroutine the_hormones::growhorm_set_level ( class(hormones), intent(inout)  this,
real(srp), intent(in)  value_set 
)

Set the value of growth hormone.

Parameters
[in]value_setvalue, Set the value of the growth hormone.

Definition at line 257 of file m_hormon.f90.

◆ thyroid_get_level()

elemental real(srp) function the_hormones::thyroid_get_level ( class(hormones), intent(in)  this)

Get the value of thyroid.

Returns
value, Returns the value of the thyroid hormone.

Definition at line 269 of file m_hormon.f90.

◆ thyroid_set_level()

elemental subroutine the_hormones::thyroid_set_level ( class(hormones), intent(inout)  this,
real(srp), intent(in)  value_set 
)

Set the value of thyroid.

Parameters
[in]value_setvalue, Set the value of the thyroid hormone.

Definition at line 281 of file m_hormon.f90.

◆ adrenaline_get_level()

elemental real(srp) function the_hormones::adrenaline_get_level ( class(hormones), intent(in)  this)

Get the value of adrenaline.

Returns
value, Returns the value of adrenaline.

Definition at line 293 of file m_hormon.f90.

◆ adrenaline_set_level()

elemental subroutine the_hormones::adrenaline_set_level ( class(hormones), intent(inout)  this,
real(srp), intent(in)  value_set 
)

Set the value of adrenaline.

Parameters
[in]value_setvalue, Set the value of the adrenaline.

Definition at line 305 of file m_hormon.f90.

◆ cortisol_get_level()

elemental real(srp) function the_hormones::cortisol_get_level ( class(hormones), intent(in)  this)

Get the value of cortisol.

Returns
value, Returns the value of cortisol

Definition at line 317 of file m_hormon.f90.

◆ cortisol_set_level()

elemental subroutine the_hormones::cortisol_set_level ( class(hormones), intent(inout)  this,
real(srp), intent(in)  value_set 
)

Set the value of cortisol.

Parameters
[in]value_setvalue, Set the value of the cortisol.

Definition at line 329 of file m_hormon.f90.

◆ testosterone_get_level()

elemental real(srp) function the_hormones::testosterone_get_level ( class(hormones), intent(in)  this)

Get the value of testosterone.

Returns
value, Returns the value of testosterone

Definition at line 341 of file m_hormon.f90.

◆ testosterone_set_level()

elemental subroutine the_hormones::testosterone_set_level ( class(hormones), intent(inout)  this,
real(srp), intent(in)  value_set,
logical, intent(in), optional  update_history 
)

Set the value of testosterone.

Parameters
[in]value_setvalue_set, Set the value of the testosterone.
[in]update_historyupdate_history is an optional logical flag to update the hormone history stack, the default is to do update, no update only if explicitly set to FALSE.

Definition at line 353 of file m_hormon.f90.

◆ estrogen_get_level()

elemental real(srp) function the_hormones::estrogen_get_level ( class(hormones), intent(in)  this)

Get the value of estrogen.

Returns
value, Returns the value of estrogen

Definition at line 375 of file m_hormon.f90.

◆ estrogen_set_level()

elemental subroutine the_hormones::estrogen_set_level ( class(hormones), intent(inout)  this,
real(srp), intent(in)  value_set,
logical, intent(in), optional  update_history 
)

Set the value of estrogen.

Parameters
[in]value_setvalue, Set the value of the estrogen.
[in]update_historyupdate_history is an optional logical flag to update the hormone history stack, the default is to do update, no update only if explicitly set to FALSE.

Definition at line 387 of file m_hormon.f90.

◆ testosteron_baseline_get_level()

elemental real(srp) function the_hormones::testosteron_baseline_get_level ( class(hormones), intent(in)  this)

Get the value of testosterone baseline.

Returns
value, Returns the value of testosterone baseline.

Definition at line 410 of file m_hormon.f90.

◆ estrogen_baseline_get_level()

elemental real(srp) function the_hormones::estrogen_baseline_get_level ( class(hormones), intent(in)  this)

Get the value of estrogen baseline.

Returns
value, Returns the value of testosterone baseline.

Definition at line 422 of file m_hormon.f90.

Variable Documentation

◆ modname

character (len=*), parameter, private the_hormones::modname = "(THE_HORMONES)"
private

Definition at line 25 of file m_hormon.f90.