25 character (len=*),
parameter,
private ::
modname =
"(THE_INDIVIDUAL)"
47 real(
srp) :: ind_mortality
72 procedure,
public :: get_mortality => &
103 logical,
optional,
intent(in) :: exclude_genome
107 if (
present(exclude_genome))
then
108 if (exclude_genome .eqv. .
false.)
then
109 call this%init_genome()
112 call this%init_genome()
116 call this%spatial_history_clean()
118 call this%init_hormones()
119 call this%init_condition()
120 call this%init_reproduction()
121 call this%init_neurobio()
131 this%ind_mortality = &
137 call this%fitness_calc()
152 call this%spatial_history_clean()
154 call this%create_genome()
157 call this%hormone_history_clean()
158 call this%growhorm_set(
missing)
160 call this%adrenaline_set(
missing)
161 call this%cortisol_set(
missing)
170 call this%body_history_clean()
175 call this%init_reproduction()
176 call this%init_neurobio()
207 call this%init_reproduction()
208 call this%init_neurobio()
234 get_val = this%ind_mortality
254 if ( this%is_dead() )
then
255 this%fitness = int_fitness_dead
285 integer :: fitness_out
288 real(
srp),
parameter :: int_multiplier_fitness = 1000.0_srp
291 integer,
parameter :: int_weight_feeding = 80
294 integer,
parameter :: int_weight_offspring = 400
297 fitness_out = nint( int_multiplier_fitness * &
298 ( this%get_mass_birth() / this%get_mass() ) )
302 if (this%n_eaten_indicator>0) fitness_out = fitness_out / &
303 ( this%n_eaten_indicator * int_weight_feeding )
316 if (this%get_offspring()>0) fitness_out = fitness_out / &
317 ( this%get_offspring() * int_weight_offspring )
327 integer :: fitness_out
331 real(
srp),
parameter :: int_multiplier_fitness = 10.0_srp
338 fitness_out = nint( int_multiplier_fitness * &
339 this%get_mass() / this%get_stom_content() )
349 integer :: fitness_out
353 real(
srp),
parameter :: int_multiplier_fitness = 100.0_srp
360 fitness_out = nint( int_multiplier_fitness * &
361 1.0_srp / this%get_stom_content() )
371 integer :: fitness_out
375 real(
srp),
parameter :: int_multiplier_fitness = 10000.0_srp
382 fitness_out = nint( int_multiplier_fitness * &
383 1.0_srp / this%mass_eaten_indicator )
393 integer :: fitness_out
397 real(
srp),
parameter :: int_multiplier_fitness = 10.0_srp
399 if (this%get_mass() <= this%get_mass_birth())
then
400 fitness_out = 1000 - this%n_eaten_indicator
404 fitness_out = nint( int_multiplier_fitness * &
405 this%get_mass_birth() / (this%get_mass() - this%get_mass_birth()) )
415 integer :: fitness_out
419 real(
srp),
parameter :: int_multiplier_fitness = 10.0_srp
421 if (this%get_mass() <= this%get_mass_birth())
then
422 fitness_out = 1000 - this%n_eaten_indicator
426 fitness_out = nint( int_multiplier_fitness * &
427 1.0_srp / (this%get_mass() - this%get_mass_birth()) )
437 integer :: fitness_out
441 real,
parameter :: int_multiplier_fitness = 100.0_srp
443 if (this%get_mass() <= this%get_mass_birth())
then
444 fitness_out = 1000 -
within( this%n_eaten_indicator, 0, 100 )
448 fitness_out =nint( int_multiplier_fitness * &
449 1.0_srp / this%reproductive_factor() )
459 integer :: fitness_out
460 real(
hrp) :: fitness_real
464 real(
hrp),
parameter :: int_multiplier_fitness = 100000.0_hrp
469 real(
srp),
parameter :: fitness_weight_energy = 0.9_srp
471 fitness_real = real( this%get_energy() * fitness_weight_energy + &
472 this%reproductive_factor() * &
473 (1.0_srp - fitness_weight_energy ),
hrp )
476 nint( int_multiplier_fitness / fitness_real )
479 fitness_out =
within( fitness_out, 0, int_fitness_dead )
490 integer :: fitness_out
491 real(
hrp) :: fitness_real
496 real(
hrp),
parameter :: int_multiplier_fitness = 10000.0_hrp
503 real(
srp),
parameter :: fitness_weight_masinc = 0.30_srp, &
504 fitness_weight_energy = 0.60_srp
507 associate( bm => this%body_mass_birth, &
509 e => this%energy_current, &
510 r => this%reproductive_factor(), &
511 z1 => int_multiplier_fitness, &
512 zm => fitness_weight_masinc, &
513 ze => fitness_weight_energy )
520 fitness_out = z1 * 100.0_hrp - z1 * (m - bm) / bm
527 real( ((m - bm) / bm) * zm + e * ze + r * (1.0_srp - ze -zm )&
531 nint( z1 / fitness_real )
537 fitness_out =
within( fitness_out, 0, int_fitness_dead )
Checks if a real number is near 0.0. Thus function can be used for comparing two real values like thi...
Force a value within the range set by the vmin and vmax dummy parameter values.
elemental integer function fitness_mass_incr_ratio()
Fitness is calculated as the mass increment in units of birth mass.
elemental integer function fitness_stomach_mass_ratio()
Fitness is calculated as the ratio of the body mass to the stomach content.
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 t...
elemental integer function fitness_food_mass_sum()
Fitness is calculated as the cumulative mass of all food objects eaten.
elemental integer function fitness_energy_reprfact()
Fitness as a weighted combination of energy and reproductive factor.
elemental integer function fitness_stomach_mass_abs()
Fitness is calculated as the absolute stomach content.
elemental integer function fitness_reprod_factor()
Fitness as the reproductive factor.
elemental integer function fitness_energy_reprfact_mass()
Fitness as a weighted combination of mass increment, energy, and reproductive factor.
elemental integer function fitness_mass_incr_abs()
Fitness is calculated as absolute mass increment from the birth mass.
COMMONDATA – definitions of global constants and procedures.
real(srp), parameter, public individual_mortality_risk_cv
The coefficient of variation for Gaussian stochastic individually-specific mortality risk of the agen...
real(srp), parameter, public tolerance_low_def_srp
Default value of low tolerance (high precision). This is the standard commondata::srp precision....
integer, parameter, public ga_fitness_dead
Fitness value ascribed to dead agent in pre-evol. See the_individual::individual_agent::fitness_calc(...
integer, parameter, public srp
Definition of the standard real type precision (SRP).
elemental real(srp) function cv2variance(cv, mean)
Calculate the variance from the coefficient of variation.
real(srp), parameter, public missing
Numerical code for missing and invalid real type values.
integer, parameter, public hrp
Definition of the high real precision (HRP). This real type kind is used in pieces where a higher lev...
real(srp), parameter, public zero
Some parameters should never be zero or below. In such cases they could be set to some smallest disti...
real(srp), parameter, public individual_mortality_risk_def
Default individually-specific mortality risk. It can increase or decrease depending on various factor...
logical, parameter, public false
Definition of high level behavioural architecture.
character(len= *), parameter, private modname
Definition the genetic architecture of the agent.
An umbrella module that collects all the components of the individual agent.
subroutine individual_create_zero(this)
Generate a new empty agent.
subroutine, private individual_init_random(this, exclude_genome)
Generate a random agent from the genotype.
elemental real(srp) function individual_get_risk_mortality_individual(this)
Get the individually-specific mortality risk for the agent.
elemental subroutine individual_agent_set_dead(this)
Set the individual to be dead. Note that this function does not deallocate the individual agent objec...
subroutine kill_destroy(this)
Finalisation procedure. Note that finalisation of objects may not yet be implemented in the compiler....
elemental subroutine individual_preevol_fitness_calc(this)
Calculate fitness for the pre-evolution phase of the genetic algorithm. Pre-evolution is based on sel...
Definition of the decision making and behavioural the architecture.
This type is an "umbrella" for all the lower-level classes.
This type describes parameters of the individual agent.