The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
m_indiv.f90 File Reference

Definition of the individual agent in the AHA Model. More...

Go to the source code of this file.

Data Types

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

Modules

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

Functions/Subroutines

subroutine, private the_individual::individual_init_random (this, exclude_genome)
 Generate a random agent from the genotype. More...
 
subroutine the_individual::individual_create_zero (this)
 Generate a new empty agent. More...
 
elemental subroutine the_individual::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 the_individual::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 the_individual::individual_get_risk_mortality_individual (this)
 Get the individually-specific mortality risk for the agent. More...
 
elemental subroutine the_individual::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...
 
elemental integer function fitness_birth_mass_ratio ()
 Fitness is calculated as the ratio of the birth mass to the current mass. This value is weighted by the multiplier (1000) to get a fairly large integer (so decimals are unimportant) and also weighted by the number of food items eaten and the number of offspring produced. More...
 
elemental integer function fitness_stomach_mass_ratio ()
 Fitness is calculated as the ratio of the body mass to the stomach content. More...
 
elemental integer function fitness_stomach_mass_abs ()
 Fitness is calculated as the absolute stomach content. More...
 
elemental integer function fitness_food_mass_sum ()
 Fitness is calculated as the cumulative mass of all food objects eaten. More...
 
elemental integer function fitness_mass_incr_ratio ()
 Fitness is calculated as the mass increment in units of birth mass. More...
 
elemental integer function fitness_mass_incr_abs ()
 Fitness is calculated as absolute mass increment from the birth mass. More...
 
elemental integer function fitness_reprod_factor ()
 Fitness as the reproductive factor. More...
 
elemental integer function fitness_energy_reprfact ()
 Fitness as a weighted combination of energy and reproductive factor. More...
 
elemental integer function fitness_energy_reprfact_mass ()
 Fitness as a weighted combination of mass increment, energy, and reproductive factor. More...
 

Variables

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

Detailed Description

Definition of the individual agent in the AHA Model.

Author
Sergey Budaev serge.nosp@m.y.bu.nosp@m.daev@.nosp@m.uib..nosp@m.no
Jarl Giske jarl..nosp@m.gisk.nosp@m.e@uib.nosp@m..no
Date
2016-2017

Definition in file m_indiv.f90.

Function/Subroutine Documentation

◆ fitness_birth_mass_ratio()

elemental integer function individual_preevol_fitness_calc::fitness_birth_mass_ratio

Fitness is calculated as the ratio of the birth mass to the current mass. This value is weighted by the multiplier (1000) to get a fairly large integer (so decimals are unimportant) and also weighted by the number of food items eaten and the number of offspring produced.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

INT_WEIGHT_FEEDING is an integer weight given to the any non-zero successful feeding.

INT_WEIGHT_OFFSPRING is an integer weight given to the any non-zero successful reproductions

Initial fitness is the ratio of the birth mass to the current mass weighted by the INT_MULTIPLIER_FITNESS.

If the agent successfully caught and eaten any number of food items, its fitness is divided by the number of food items eaten weighted by the INT_WEIGHT_FEEDING parameter.

If the agent has successfully done any reproduction, its fitness is divided by the number of offspring weighted by INT_WEIGHT_OFFSPRING.

Definition at line 283 of file m_indiv.f90.

◆ fitness_stomach_mass_ratio()

elemental integer function individual_preevol_fitness_calc::fitness_stomach_mass_ratio

Fitness is calculated as the ratio of the body mass to the stomach content.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

Definition at line 325 of file m_indiv.f90.

◆ fitness_stomach_mass_abs()

elemental integer function individual_preevol_fitness_calc::fitness_stomach_mass_abs

Fitness is calculated as the absolute stomach content.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

Definition at line 347 of file m_indiv.f90.

◆ fitness_food_mass_sum()

elemental integer function individual_preevol_fitness_calc::fitness_food_mass_sum

Fitness is calculated as the cumulative mass of all food objects eaten.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

Definition at line 369 of file m_indiv.f90.

◆ fitness_mass_incr_ratio()

elemental integer function individual_preevol_fitness_calc::fitness_mass_incr_ratio

Fitness is calculated as the mass increment in units of birth mass.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

Definition at line 391 of file m_indiv.f90.

◆ fitness_mass_incr_abs()

elemental integer function individual_preevol_fitness_calc::fitness_mass_incr_abs

Fitness is calculated as absolute mass increment from the birth mass.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

Definition at line 413 of file m_indiv.f90.

◆ fitness_reprod_factor()

elemental integer function individual_preevol_fitness_calc::fitness_reprod_factor

Fitness as the reproductive factor.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

Definition at line 435 of file m_indiv.f90.

◆ fitness_energy_reprfact()

elemental integer function individual_preevol_fitness_calc::fitness_energy_reprfact

Fitness as a weighted combination of energy and reproductive factor.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.

INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.

FITNESS_WEIGHT_ENERGY is the weighting factor for energy, respective weighting for the reproductive factor is then 1 - FITNESS_WEIGHT_ENERGY.

Fitness of an alive agent cannot be smaller than in a dead agent.

Definition at line 457 of file m_indiv.f90.

◆ fitness_energy_reprfact_mass()

elemental integer function individual_preevol_fitness_calc::fitness_energy_reprfact_mass

Fitness as a weighted combination of mass increment, energy, and reproductive factor.

Note
This procedure is internal to the_individual::individual_agent::fitness_calc().
Returns
Fitness value.
  • INT_MULTIPLIER_FITNESS is a multiplier to set the appropriate scaling for the initial the_individual::individual_agent::fitness.
  • FITNESS_WEIGHT_MASINC is the weighting factor for relative weight increment.
    • FITNESS_WEIGHT_ENERGY is the weighting factor for energy,
Note
their sum must not exceed 1.0

If mass increment is negative, fitness is given a big value 1000,000,

Note
Note that this should be smaller than the fitness of a dead agent defined in commondata::ga_fitness_dead .

Then fitness function is calculated as a weighted sum of relative weight increment W1 (M-Mb)/Mb + W2 E + W3 Rf

Fitness of an alive agent is always limited to lay within the range from 0 to fitness of a dead agent.

Definition at line 488 of file m_indiv.f90.

Here is the caller graph for this function: