The AHA Model
Revision: 12809
Reference implementation 04 (HEDG02_04)
|
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)" |
An umbrella module that collects all the components of the individual agent.
Define the individual fish object and its properties and methods/functions
|
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.
[in] | exclude_genome | exclude_genome is a logical flag to exclude initialisation of random genome. If absent, assumed FALSE. |
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.
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.
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.
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):
Definition at line 203 of file m_indiv.f90.
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.
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.
Definition at line 228 of file m_indiv.f90.
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.
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.
|
private |
Definition at line 25 of file m_indiv.f90.