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

An umbrella module that collects all the components of the individual agent. More...

Data Types

type  individual_agent
 This type describes parameters of the individual agent. More...
 

Functions/Subroutines

subroutine, private individual_init_random (this, exclude_genome)
 Generate a random agent from the genotype. More...
 
subroutine individual_create_zero (this)
 Generate a new empty agent. More...
 
elemental subroutine individual_agent_set_dead (this)
 Set the individual to be dead. Note that this function does not deallocate the individual agent object, this may be a separate destructor function. More...
 
subroutine kill_destroy (this)
 Finalisation procedure. Note that finalisation of objects may not yet be implemented in the compiler. Therefore this subroutine is not used so far, just a stub. More...
 
elemental real(srp) function individual_get_risk_mortality_individual (this)
 Get the individually-specific mortality risk for the agent. More...
 
elemental subroutine individual_preevol_fitness_calc (this)
 Calculate fitness for the pre-evolution phase of the genetic algorithm. Pre-evolution is based on selection for a simple criterion without explicit reproduction etc. The criterion for selection at this phase is set by the integer the_individual::individual_agent::fitness component. More...
 

Variables

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

Detailed Description

An umbrella module that collects all the components of the individual agent.

THE_INDIVIDUAL module

Define the individual fish object and its properties and methods/functions

Function/Subroutine Documentation

◆ individual_init_random()

subroutine, private the_individual::individual_init_random ( class(individual_agent), intent(inout)  this,
logical, intent(in), optional  exclude_genome 
)
private

Generate a random agent from the genotype.

This subroutine is used to initialise the individual agent with random data from the genotype. Its use is the most natural for the initialisation of a population of agents. The init procedure calls the init functions for the lower order layers of the class hierarchy (genome, hormones, neurobio), and sets values.

Parameters
[in]exclude_genomeexclude_genome is a logical flag to exclude initialisation of random genome. If absent, assumed FALSE.
Note
Only the first generation is initialised with random genome (exclude_genome = FALSE), all subsequent generations use pre-existing genomes from the ancestors (exclude_genome = TRUE) randomised by crossover in the genetic algorithm.

We first initialise all the components of the agent down the class hierarchy: from individual genome to the neurobiological architecture.

Clean the spatial location history stack of the agent.

initialise hormone objects from genome

initialise condition from genome

initialise empty reproduction objects

initialise empty neuro objects

Finally, we bring the agent to life by setting alive boolean flag

Set the individually specific mortality risk initially as a Gaussian variable with mean commondata::individual_mortality_risk_def and CV commondata::individual_mortality_risk_cv. There is also a restriction that the risk of mortality should never be smaller than commondata::zero.

Calculate the initial value of fitness for pre-evolution stage.

Definition at line 94 of file m_indiv.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ individual_create_zero()

subroutine the_individual::individual_create_zero ( class(individual_agent), intent(inout)  this)

Generate a new empty agent.

This subroutine is used to create a new empty individual agent. It should be used to make newborn agents that inherit traits from their parents.

Warning
This procedure is not used so far and is candidate for being deprecated. Not clear if necessary.

Clean the spatial location history stack of the agent.

create empty genome

Create empty hormone objects. No genome-based initialisation is done.

Empty condition objects. Clean history stack.

Initialise reproduction objects and neurobiology to a zero state.

Finally, we bring the agent to life by setting alive boolean flag

Calculate the initial value of fitness for pre-evolution stage.

Definition at line 148 of file m_indiv.f90.

◆ individual_agent_set_dead()

elemental subroutine the_individual::individual_agent_set_dead ( class(individual_agent), intent(inout)  this)

Set the individual to be dead. Note that this function does not deallocate the individual agent object, this may be a separate destructor function.

The dies method is implemented at the following levels of the agent object hierarchy (upper overrides the lower level):

Note
This method overrides the the_genome::individual_genome::dies() method, nullifying all reproductive and neurobiological and behavioural objects.
  • Set the agent "dead";
  • emptify reproduction objects;
  • emptify neurobiological objects.

Definition at line 203 of file m_indiv.f90.

◆ kill_destroy()

subroutine the_individual::kill_destroy ( class(individual_agent), intent(inout)  this)

Finalisation procedure. Note that finalisation of objects may not yet be implemented in the compiler. Therefore this subroutine is not used so far, just a stub.

Definition at line 216 of file m_indiv.f90.

◆ individual_get_risk_mortality_individual()

elemental real(srp) function the_individual::individual_get_risk_mortality_individual ( class(individual_agent), intent(in)  this)

Get the individually-specific mortality risk for the agent.

Returns
Individually-specific mortality risk for the agent.

Definition at line 228 of file m_indiv.f90.

◆ individual_preevol_fitness_calc()

elemental subroutine the_individual::individual_preevol_fitness_calc ( class(individual_agent), intent(inout)  this)

Calculate fitness for the pre-evolution phase of the genetic algorithm. Pre-evolution is based on selection for a simple criterion without explicit reproduction etc. The criterion for selection at this phase is set by the integer the_individual::individual_agent::fitness component.

Warning
Note that fitness here is actually an "antifitness", the higher its value, the worse fitting is the agent.

INT_FITNESS_DEAD is the fitness ascribed to the dead agent, it should be a very large value greater than for any alive.

First check if the agent is dead. If so, give very high value that is never selected.

Now, the reverse of fitness can be calculated by various methods. Specific calculation functions are implemented within this function. So far the following routines were implemented:

Definition at line 245 of file m_indiv.f90.

Here is the call graph for this function:

Variable Documentation

◆ modname

character (len=*), parameter, private the_individual::modname = "(THE_INDIVIDUAL)"
private

Definition at line 25 of file m_indiv.f90.