The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
the_genome::individual_genome Type Reference

This type describes parameters of the individual agent's genome The genome is an array of allocatable the_genome::chromosome objects, different kinds of agents may have different genomes with different number of chromosomes. See "the genome structure" for as general description and "genome" for details. More...

Inheritance diagram for the_genome::individual_genome:
Collaboration diagram for the_genome::individual_genome:

Public Member Functions

procedure, public init_genome => genome_init_random
 Initialise the genome at random, and set sex as determined by the sex determination locus. See the_genome::genome_init_random() More...
 
procedure, public create_genome => genome_create_zero
 Create a new empty genome, and set sex as determined by the sex determination locus. Genome values are from parents using inherit functions. See the_genome::genome_create_zero() More...
 
procedure, public label => genome_label_set
 Label genome. If label is not provided, make a random string. More...
 
procedure, public individ_label => genome_label_get
 Accessor function to get the genome label. The label is a kind of a (random) text string name of the genome and the individual agent. More...
 
procedure, public sex_init => genome_sex_determine_init
 Sex has a separate status from all other genetically determined traits. It is initialised here, at the genotype level of the class hierarchy. See the_genome::genome_sex_determine_init() More...
 
procedure, public is_male => genome_get_sex_is_male
 Get the logical sex ID of the genome object component. See the_genome::genome_get_sex_is_male() More...
 
procedure, public is_female => genome_get_sex_is_female
 Get the logical sex ID of the genome object component. See the_genome::genome_get_sex_is_female() More...
 
procedure, public label_sex => genome_get_sex_label
 Get the descriptive sex label: male or female. See the_genome::genome_get_sex_label() More...
 
procedure, public trait_init => trait_init_genotype_gamma2gene
 Init a trait from the genotype, trait can be any object in any of the up level class hierarchy that is determined from the boolean genotype x phenotype matrix. See the_genome::trait_init_genotype_gamma2gene() More...
 
procedure, public trait_set => trait_set_genotype_gamma2gene
 Set an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. See the_genome::trait_set_genotype_gamma2gene() More...
 
generic, public neuro_resp => trait_init, trait_set
 Generic interface to the neuronal response function. See the_genome::trait_init_genotype_gamma2gene() and the_genome::trait_set_genotype_gamma2gene(). More...
 
procedure, public trait_init_linear => trait_init_linear_sum_additive_comps_2genes_r
 Init a trait from the genotype, trait can be any object in any of the up level class hierarchy that is determined from the boolean genotype x phenotype matrix. Note that this method is based on simple linear rescale rather than neuronal response. See the_genome::trait_init_linear_sum_additive_comps_2genes_r() More...
 
procedure, public trait_set_linear => trait_set_linear_sum_additive_comps_2genes_r
 Set an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. Note that this method is based on simple linear rescale rather than neuronal response. See the_genome::trait_set_linear_sum_additive_comps_2genes_r() More...
 
generic, public linear_g2p => trait_init_linear, trait_set_linear
 Generic interface to the simple linear genotype to phenotype transformation functions. See the_genome::trait_init_linear_sum_additive_comps_2genes_r() and the_genome::trait_set_linear_sum_additive_comps_2genes_r(). More...
 
procedure, public lives => genome_individual_set_alive
 Set the individual to be alive, normally this function is used after init or birth. See the_genome::genome_individual_set_alive() More...
 
procedure, public dies => genome_individual_set_dead
 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): More...
 
procedure, public set_dead => genome_individual_set_dead
 Set the individual to be dead. Note that in this class this method implementation points to the same procedure as the_genome::individual_genome::dies(). However thedies` method is overriden upwards in the class hierarchy to also nullify neurobiological and behavioural objects. So this method should be only called in procedures that specifically implemented override of the dies method: More...
 
procedure, public is_alive => genome_individual_check_alive
 Check if the individual is alive. See the_genome::genome_individual_check_alive() More...
 
procedure, public is_dead => genome_individual_check_dead
 Check if the individual is dead (the opposite of is_alive). See the_genome::genome_individual_check_dead() More...
 
procedure, public recombine_random => genome_individual_recombine_homol_full_rand_alleles
 Internal genetic recombination backend, exchange individual alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. Fully random recombination. See the_genome::genome_individual_recombine_homol_full_rand_alleles(). More...
 
procedure, public recombine_partial => genome_individual_recombine_homol_part_rand_alleles
 Internal genetic recombination backend, exchange individual alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. Partially random recombination. See the_genome::genome_individual_recombine_homol_part_rand_alleles(). More...
 
procedure, public crossover => genome_individual_crossover_homol_fix
 Internal fixed genetic crossover backend, exchange blocks of alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. See the_genome::genome_individual_crossover_homol_fix(). More...
 
procedure, public mutate => genome_mutate_wrapper
 Perform a probabilistic random mutation(s) on the individual genome. This is a high level wrapper to build mutations from various components. See the_genome::genome_mutate_wrapper(). More...
 
- Public Member Functions inherited from the_environment::spatial_moving
procedure, public create => spatial_moving_create_3d
 Create a new spatial moving object. Initially it has no position, all coordinate values are commondata::missing or commondata::invalid for real type coordinates. See the_environment::spatial_moving_create_3d() More...
 
procedure, public position => spatial_moving_fix_position_3d_o
 Place spatial movable object into a 3D space, define the object's current coordinates, but first save previous coordinates. Object-based. See the_environment::spatial_moving_fix_position_3d_o() More...
 
procedure, public repeat_position => spatial_moving_repeat_position_history_3d
 Repeat/re-save the current position into the positional history stack. See the_environment::spatial_moving_repeat_position_history_3d(). More...
 
procedure, public position_v => spatial_moving_fix_position_3d_v
 Place spatial movable object into a 3D space, define the object's current coordinates, but first save previous coordinates. Vector-based. See the_environment::spatial_moving_fix_position_3d_v() More...
 
procedure, public spatial_history_clean => spatial_moving_clean_hstory_3d
 Create a new empty history of positions for spatial moving object. Assign all values to the commondata::missing value code. See the_environment::spatial_moving_clean_hstory_3d() More...
 
procedure, public way => spatial_moving_self_distance_3d
 Calculate the Euclidean distance between the current and previous position of a single spatial movable object. Optionally, it also calculates the total distance traversed during the from_history points from the history stack along with the distance from the current position and the last historical value. See the_environment::spatial_moving_self_distance_3d(). More...
 
procedure, public go_up => spatial_moving_go_up
 The spatial moving object ascends, goes up the depth with specific fixed step size. See the_environment::spatial_moving_go_up(). More...
 
procedure, public go_down => spatial_moving_go_down
 The spatial moving object decends, goes down the depth with specific fixed step size. See the_environment::spatial_moving_go_down(). More...
 
procedure, public rwalk3d => spatial_moving_randomwalk_gaussian_step_3d
 Implements an optionally environment-restricted Gaussian random walk in 3D. See the_environment::spatial_moving_randomwalk_gaussian_step_3d(). More...
 
procedure, public rwalk25d =>spatial_moving_randomwalk_gaussian_step_25d
 Implements an optionally environment-restricted Gaussian random walk in a "2.5 dimensions", i.e. 2D x y with separate walk parameters for the third depth dimension. See the_environment::spatial_moving_randomwalk_gaussian_step_25d(). More...
 
generic, public rwalk => rwalk3d, rwalk25d
 Implements an optionally environment-restricted Gaussian random walk. Generic interface for 3D and 3.5D moves. See the_environment::spatial_moving_randomwalk_gaussian_step_3d() and the_environment::spatial_moving_randomwalk_gaussian_step_25d(). More...
 
procedure, public corwalk3d => spatial_moving_corwalk_gaussian_step_3d
 Implements an optionally environment-restricted correlated directional Gaussian random walk in 3D towards (or away of) an the_environment::spatial class target object. See the_environment::spatial_moving_corwalk_gaussian_step_3d(). More...
 
procedure, public corwalk25d =>spatial_moving_corwalk_gaussian_step_25d
 Implements an optionally environment-restricted correlated directional Gaussian random walk in 3D towards (or away of) an the_environment::spatial class target object. See the_environment::spatial_moving_corwalk_gaussian_step_25d(). More...
 
generic, public corwalk => corwalk3d, corwalk25d
 Implements an optionally environment-restricted correlated directional Gaussian random walk. corwalk is a generic interface for 3D and "2.5"D moves. For details see the 3d version and a version with separate X,Y and depth random parameters. More...
 
procedure, public dirwalk3d => spatial_moving_dirwalk_gaussian_step_3d
 Implements an optionally environment-restricted directional Gaussian random walk in 3D towards a target the_environment::spatial object. See the_environment::spatial_moving_dirwalk_gaussian_step_3d() More...
 
procedure, public dirwalk25d =>spatial_moving_dirwalk_gaussian_step_25d
 Implements an optionally environment-restricted directional Gaussian random walk in "2.5"D towards a target object. i.e. 2D x y with separate walk parameters for the third depth dimension. See the_environment::spatial_moving_dirwalk_gaussian_step_25d() More...
 
generic, public dirwalk => dirwalk3d, dirwalk25d
 Implements an optionally environment-restricted directional Gaussian random walk. Generic interface for 3D and "2.5"D moves. More...
 
- Public Member Functions inherited from the_environment::spatial
procedure, public create => spatial_create_empty
 Create an empty spatial object. More...
 
procedure, public position => spatial_fix_position_3d_o
 Place spatial object into a 3D space, define the object's current coordinates. Object-based procedure. See the_environment::spatial_fix_position_3d_o() More...
 
procedure, public position_v => spatial_fix_position_3d_s
 Place spatial object into a 3D space, define the object's current coordinates. Vector-based procedure. See the_environment::spatial_fix_position_3d_s() More...
 
procedure, public missing => spatial_make_missing
 Assign all MISSING coordinates to the SPATIAL object. See the_environment::spatial_make_missing() More...
 
procedure, public distance => spatial_distance_3d
 Calculate the Euclidean distance between two spatial objects. See the_environment::spatial_distance_3d() More...
 
procedure, public distance_segment2d => geo_poly2d_dist_point_to_section
 Calculates the minimum distance from a the_environment::spatial class object to a line segment delimited by two the_environment::spatial endpoints in the 2D XY plane (the depth coordinate is ignored). See the_environment::geo_poly2d_dist_point_to_section(). More...
 
procedure, public distance_segment => geo_poly3d_dist_point_to_section
 Calculates the minimum distance from a the_environment::spatial class object to a line segment delimited by two the_environment::spatial class endpoints in the 3D XY space. See the_environment::geo_poly3d_dist_point_to_section(). More...
 
procedure, public way => spatial_self_distance_3d
 Calculate the Euclidean distance between the current and previous position of a single spatial object. See the_environment::spatial_self_distance_3d() More...
 
procedure, public is_within => spatial_check_located_within_3d
 Function to check if this spatial object is located within an area set by an environmental object See the_environment::spatial_check_located_within_3d() More...
 
procedure, public find_environment => spatial_get_environment_in_pos
 Identify in which environment from the input list this spatial agent is currently in. See the_environment::spatial_get_environment_in_pos(). More...
 
procedure, public is_below => spatial_check_located_below
 Logical function to check if the argument spatial object(s) is(are) located below this spatial object. See the_environment::spatial_check_located_below() More...
 
procedure, public is_above => spatial_check_located_above
 Logical function to check if the argument spatial object(s) is(are) located above this spatial object. See the_environment::spatial_check_located_above() More...
 
procedure, public nearest => spatial_get_nearest_object
 Determine the nearest spatial object to this spatial object among an array of other spatial objects. See the_environment::spatial_get_nearest_object() More...
 
procedure, public nearest_num => spatial_get_nearest_id
 Determine the nearest spatial object to this spatial object among an array of other spatial objects. See the_environment::spatial_get_nearest_id() More...
 
procedure, public neighbours => spatial_neighbours_distances
 Calculate the distances between this spatial object and an array of its neighbours. Optionally output the distances, sorting index vector and rankings vector for each of these neighbours. Optionally do only partial indexing, up to the order rank_max for computational speed. See the_environment::spatial_neighbours_distances() More...
 
procedure, public now_o => spatial_get_current_pos_3d_o
 Get the current spatial position of a SPATIAL object. Object-based. See the_environment::spatial_get_current_pos_3d_o() More...
 
procedure, public now_v => spatial_get_current_pos_3d_v
 Get the current spatial position of a SPATIAL object. Vector-based. See the_environment::spatial_get_current_pos_3d_v() More...
 
generic, public location => now_o, now_v
 Get the current spatial position of a SPATIAL object. Generic interface/alias. More...
 
generic, public now => now_o, now_v
 Get the current spatial position of a SPATIAL object. Generic interface/alias. More...
 
procedure, public xpos => spatial_get_current_pos_x_3d
 Get the current X position of a SPATIAL object. See the_environment::spatial_get_current_pos_x_3d() More...
 
procedure, public ypos => spatial_get_current_pos_y_3d
 Get the current Y position of a SPATIAL object. See the_environment::spatial_get_current_pos_y_3d() More...
 
procedure, public dpos => spatial_get_current_pos_d_3d
 Get the current Z (depth) position of a SPATIAL object. See the_environment::spatial_get_current_pos_d_3d() More...
 
procedure, public illumination => spatial_calc_irradiance_at_depth
 Calculate the illumination (background irradiance) at the depth of the spatial object at an arbitrary time step of the model. See the_environment::spatial_calc_irradiance_at_depth() More...
 
procedure, public visibility => spatial_visibility_visual_range_cm
 Calculate the visibility range of a spatial object. Wrapper to the visual_range function. This function calculates the distance from which this object can be seen by a visual object (e.g. predator or prey). See the_environment::spatial_visibility_visual_range_cm(). More...
 

Public Attributes

character(len=label_length) genome_label
 label for the genome More...
 
integer genome_size = N_CHROMOSOMES
 the size of the genome, i.e. N of chromosomes = N_CHROMOSOMES in this version it is constant, can implement variable genomes later. More...
 
type(chromosome), dimension(:,:), allocatable chromosome
 array of chromosome objects, the two dimensions refer to (1) chromosome number in the genome and (2) the number of homologs (1:2 for diploid), so chromosome is a 2D array. More...
 
logical sex_is_male
 The sex of the individual: is male = TRUE or female = FALSE this is the main sex identifier. The sex_label defined below should only be used for outputs and similar purposes. More...
 
character(len=label_length) sex_label
 Verbal label for sex ("male" or "female"). More...
 
logical alive
 Flag the agent is alive (TRUE) or dead (False). More...
 
- Public Attributes inherited from the_environment::spatial_moving
type(spatial), dimension(history_size_spatial) history
 We define prior historical values of the SPATIAL positions. More...
 
- Public Attributes inherited from the_environment::spatial
real(srp) x
 We define three-dimensional environment: x, y and depth. More...
 
real(srp) y
 
real(srp) depth
 

Detailed Description

This type describes parameters of the individual agent's genome The genome is an array of allocatable the_genome::chromosome objects, different kinds of agents may have different genomes with different number of chromosomes. See "the genome structure" for as general description and "genome" for details.

Definition at line 160 of file m_genome.f90.

Member Function/Subroutine Documentation

◆ init_genome()

procedure, public the_genome::individual_genome::init_genome

Initialise the genome at random, and set sex as determined by the sex determination locus. See the_genome::genome_init_random()

Definition at line 182 of file m_genome.f90.

◆ create_genome()

procedure, public the_genome::individual_genome::create_genome

Create a new empty genome, and set sex as determined by the sex determination locus. Genome values are from parents using inherit functions. See the_genome::genome_create_zero()

Definition at line 187 of file m_genome.f90.

◆ label()

procedure, public the_genome::individual_genome::label

Label genome. If label is not provided, make a random string.

Note
TMP NOTE: label setting removed from the create function as it will now override create for SPATIAL_MOVING. See the_genome::genome_label_set()

Definition at line 192 of file m_genome.f90.

◆ individ_label()

procedure, public the_genome::individual_genome::individ_label

Accessor function to get the genome label. The label is a kind of a (random) text string name of the genome and the individual agent.

Note
We especially need this accessor function because the genome (and individual) name is used in other modules for file names ids etc. See the_genome::genome_label_get()

Definition at line 198 of file m_genome.f90.

◆ sex_init()

procedure, public the_genome::individual_genome::sex_init

Sex has a separate status from all other genetically determined traits. It is initialised here, at the genotype level of the class hierarchy. See the_genome::genome_sex_determine_init()

Definition at line 203 of file m_genome.f90.

◆ is_male()

procedure, public the_genome::individual_genome::is_male

Get the logical sex ID of the genome object component. See the_genome::genome_get_sex_is_male()

Definition at line 206 of file m_genome.f90.

◆ is_female()

procedure, public the_genome::individual_genome::is_female

Get the logical sex ID of the genome object component. See the_genome::genome_get_sex_is_female()

Definition at line 209 of file m_genome.f90.

◆ label_sex()

procedure, public the_genome::individual_genome::label_sex

Get the descriptive sex label: male or female. See the_genome::genome_get_sex_label()

Definition at line 212 of file m_genome.f90.

◆ trait_init()

procedure, public the_genome::individual_genome::trait_init

Init a trait from the genotype, trait can be any object in any of the up level class hierarchy that is determined from the boolean genotype x phenotype matrix. See the_genome::trait_init_genotype_gamma2gene()

Definition at line 218 of file m_genome.f90.

◆ trait_set()

procedure, public the_genome::individual_genome::trait_set

Set an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. See the_genome::trait_set_genotype_gamma2gene()

Definition at line 222 of file m_genome.f90.

◆ neuro_resp()

generic, public the_genome::individual_genome::neuro_resp

Generic interface to the neuronal response function. See the_genome::trait_init_genotype_gamma2gene() and the_genome::trait_set_genotype_gamma2gene().

Definition at line 226 of file m_genome.f90.

◆ trait_init_linear()

procedure, public the_genome::individual_genome::trait_init_linear

Init a trait from the genotype, trait can be any object in any of the up level class hierarchy that is determined from the boolean genotype x phenotype matrix. Note that this method is based on simple linear rescale rather than neuronal response. See the_genome::trait_init_linear_sum_additive_comps_2genes_r()

Definition at line 233 of file m_genome.f90.

◆ trait_set_linear()

procedure, public the_genome::individual_genome::trait_set_linear

Set an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. Note that this method is based on simple linear rescale rather than neuronal response. See the_genome::trait_set_linear_sum_additive_comps_2genes_r()

Definition at line 240 of file m_genome.f90.

◆ linear_g2p()

generic, public the_genome::individual_genome::linear_g2p

Generic interface to the simple linear genotype to phenotype transformation functions. See the_genome::trait_init_linear_sum_additive_comps_2genes_r() and the_genome::trait_set_linear_sum_additive_comps_2genes_r().

Definition at line 246 of file m_genome.f90.

◆ lives()

procedure, public the_genome::individual_genome::lives

Set the individual to be alive, normally this function is used after init or birth. See the_genome::genome_individual_set_alive()

Definition at line 251 of file m_genome.f90.

◆ dies()

procedure, public the_genome::individual_genome::dies

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):

See the_genome::genome_individual_set_dead()

Definition at line 263 of file m_genome.f90.

◆ set_dead()

procedure, public the_genome::individual_genome::set_dead

Set the individual to be dead. Note that in this class this method implementation points to the same procedure as the_genome::individual_genome::dies(). However thedies` method is overriden upwards in the class hierarchy to also nullify neurobiological and behavioural objects. So this method should be only called in procedures that specifically implemented override of the dies method:

See the_genome::genome_individual_set_dead()

Definition at line 275 of file m_genome.f90.

◆ is_alive()

procedure, public the_genome::individual_genome::is_alive

Check if the individual is alive. See the_genome::genome_individual_check_alive()

Definition at line 278 of file m_genome.f90.

◆ is_dead()

procedure, public the_genome::individual_genome::is_dead

Check if the individual is dead (the opposite of is_alive). See the_genome::genome_individual_check_dead()

Definition at line 281 of file m_genome.f90.

◆ recombine_random()

procedure, public the_genome::individual_genome::recombine_random

Internal genetic recombination backend, exchange individual alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. Fully random recombination. See the_genome::genome_individual_recombine_homol_full_rand_alleles().

Definition at line 287 of file m_genome.f90.

◆ recombine_partial()

procedure, public the_genome::individual_genome::recombine_partial

Internal genetic recombination backend, exchange individual alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. Partially random recombination. See the_genome::genome_individual_recombine_homol_part_rand_alleles().

Definition at line 293 of file m_genome.f90.

◆ crossover()

procedure, public the_genome::individual_genome::crossover

Internal fixed genetic crossover backend, exchange blocks of alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. See the_genome::genome_individual_crossover_homol_fix().

Definition at line 299 of file m_genome.f90.

◆ mutate()

procedure, public the_genome::individual_genome::mutate

Perform a probabilistic random mutation(s) on the individual genome. This is a high level wrapper to build mutations from various components. See the_genome::genome_mutate_wrapper().

Definition at line 305 of file m_genome.f90.

Member Data Documentation

◆ genome_label

character(len=label_length) the_genome::individual_genome::genome_label

label for the genome

Definition at line 162 of file m_genome.f90.

◆ genome_size

integer the_genome::individual_genome::genome_size = N_CHROMOSOMES

the size of the genome, i.e. N of chromosomes = N_CHROMOSOMES in this version it is constant, can implement variable genomes later.

Definition at line 165 of file m_genome.f90.

◆ chromosome

type(chromosome), dimension(:,:), allocatable the_genome::individual_genome::chromosome

array of chromosome objects, the two dimensions refer to (1) chromosome number in the genome and (2) the number of homologs (1:2 for diploid), so chromosome is a 2D array.

Definition at line 169 of file m_genome.f90.

◆ sex_is_male

logical the_genome::individual_genome::sex_is_male

The sex of the individual: is male = TRUE or female = FALSE this is the main sex identifier. The sex_label defined below should only be used for outputs and similar purposes.

Definition at line 173 of file m_genome.f90.

◆ sex_label

character(len=label_length) the_genome::individual_genome::sex_label

Verbal label for sex ("male" or "female").

Definition at line 175 of file m_genome.f90.

◆ alive

logical the_genome::individual_genome::alive

Flag the agent is alive (TRUE) or dead (False).

Definition at line 177 of file m_genome.f90.


The documentation for this type was generated from the following file: