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

The Genome objects of the AHA Model. More...

Go to the source code of this file.

Data Types

type  the_genome::gene
 This describes an individual gene object. See the genome structure for as general description and gene for details. More...
 
type  the_genome::chromosome
 This type describes the chromosome object. Chromosome consists of an array of alleles and a descriptive string label. See "the genome structure" for as general description and "chromosome" for details. More...
 
type  the_genome::individual_genome
 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...
 

Modules

module  the_genome
 Definition the genetic architecture of the agent.
 

Functions/Subroutines

elemental subroutine the_genome::chromosome_sort_rank_id (this)
 Sort GENE objects within the CHROMOSOME by their rank_id. The two subroutines qsort and qs_partition_rank_id are a variant of the recursive quick-sort algorithm adapted for sorting integer components of the the CHROMOSOME object. More...
 
recursive pure subroutine qsort (A)
 qsort and qs_partition_ are the two parts of the recursive sort algorithm qsort is the recursive frontend. Sorts genes within the chromosome by components of the array of alleles. More...
 
pure subroutine qs_partition_rank_id (A, marker)
 qsort and qs_partition_ are the two parts of the recursive sort algorithm qs_partition_rank_id is a pivot backend, here it sorts genes within the chromosome object by integer rank_id components of the genes. More...
 
subroutine the_genome::allele_init_random (this)
 Initialises allele with a random integer. Note that we do not set the labels for the alleles here during the random initialisation. More...
 
elemental subroutine the_genome::allele_create_zero (this)
 Create allele with zero value. We don't set labels for alleles here. More...
 
subroutine the_genome::allele_label_init_random (this)
 The (pair of) alleles here are assigned random string labels Not sure if that is necessary for any application though. More...
 
elemental subroutine the_genome::allele_label_set (this, label)
 Set labels for the alleles. The subroutine parameter is array of labels. More...
 
elemental character(len=label_length) function the_genome::allele_label_get (this)
 Get the i-th allele label. More...
 
elemental subroutine the_genome::allele_value_set (this, set_value, nr)
 Set a single value of the allele additive component. More...
 
pure subroutine the_genome::alleles_value_vector_set (this, values)
 Set values of the alleles as a vector, i.e. sets the whole gene values. More...
 
elemental integer function the_genome::allele_value_get (this, nr)
 Get the value of the allele. More...
 
pure subroutine the_genome::allele_values_vector_get (this, values)
 Get the vector of all values of the alleles, i.e. gets the gene values. More...
 
elemental subroutine the_genome::allele_rank_id_set (this, value_id)
 
subroutine the_genome::allele_mutate_random (this, prob)
 Introduce a random point mutation to a random allele component. More...
 
subroutine the_genome::allele_mutate_random_batch (this, prob)
 Introduce a random mutation of the whole set of additive allele components. More...
 
subroutine the_genome::chromosome_init_allocate_random (this, length, label)
 This subroutine initialises the chromosome with, and allocates, random alleles, sets one of them randomly dominant and optionally defines the chromosome label. More...
 
subroutine the_genome::chromosome_create_allocate_zero (this, length, label)
 Init a new chromosome, zero, non-random. More...
 
elemental subroutine the_genome::chromosome_recalculate_rank_ids (this)
 This subroutine recalculates rank_id indices for consecutive gene objects within the chromosome. This may be necessary after reordering by random relocation mutation. More...
 
subroutine the_genome::chromosome_mutate_relocate_swap_random (this, prob)
 Mutate within the same chromosome, relocate a gene (unit of alleles) to a different random position within the same chromosome, the misplaced gene moves to the relocated gene position, so they are just swap. More...
 
subroutine the_genome::chromosome_mutate_relocate_shift_random (this, prob)
 Mutate within the same chromosome, relocate a gene (unit of alleles) to a different random position within the same chromosome, shifting all other genes within the chromosome down one position. This works as follows: first, we randomly determine the gene to relocate, assign it a new random rank_id. Then re-sort the chromosome according to the new ranks with qsort with the qs_partition_rank_id backend. More...
 
subroutine the_genome::genome_init_random (this, label)
 Initialise the genome at random, and set sex as determined by the sex determination locus. More...
 
subroutine the_genome::genome_create_zero (this)
 Create a new empty genome, and set sex as determined by the sex determination locus. Genome values are from parents using inherit functions. More...
 
subroutine the_genome::genome_label_set (this, label)
 Label genome. If label is not provided, make a random string. More...
 
elemental character(len=label_length) function the_genome::genome_label_get (this)
 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...
 
subroutine the_genome::genome_sex_determine_init (this)
 Sex determination initialisation subroutine. More...
 
elemental logical function the_genome::genome_get_sex_is_male (this)
 Get the logical sex ID of the genome object component. More...
 
elemental logical function the_genome::genome_get_sex_is_female (this)
 Get the logical sex ID of the genome object component. More...
 
elemental character(len=label_length) function the_genome::genome_get_sex_label (this)
 Get the descriptive sex label: male or female. More...
 
elemental subroutine the_genome::genome_individual_set_alive (this)
 Set the individual to be alive, normally this function is used after init or birth. More...
 
elemental subroutine the_genome::genome_individual_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...
 
elemental logical function the_genome::genome_individual_check_alive (this)
 Check if the individual is alive. More...
 
elemental logical function the_genome::genome_individual_check_dead (this)
 Check if the individual is dead (the opposite of is_alive). More...
 
subroutine the_genome::genome_individual_recombine_homol_full_rand_alleles (this, mother, father, exchange_ratio)
 Internal genetic recombination backend, exchange individual alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. Fully random recombination. More...
 
subroutine the_genome::genome_individual_recombine_homol_part_rand_alleles (this, mother, father, exchange_ratio)
 Internal genetic recombination backend, exchange individual alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. Partially random recombination, identical across the homologous chromosomes. More...
 
subroutine the_genome::genome_individual_crossover_homol_fix (this, mother, father, pattern_matrix)
 Internal fixed genetic crossover backend, exchange blocks of alleles between homologous chromosomes in mother and father genomes to form the this (offspring) genome. More...
 
subroutine the_genome::genome_mutate_wrapper (this, p_point, p_set, p_swap, p_shift)
 Perform a probabilistic random mutation(s) on the individual genome. This is a high level wrapper to build mutations from various components. More...
 
Neuronal response functions

There are two separate functions that produce a trait value from the genotype. The procedure trait_init_genotype_gamma2gene does modify the agent (this, intent[inout]) as it sets the label. On the other hand, a similar procedure the_genome::trait_set_genotype_gamma2gene() does not affect the agent, it has the intent [in].

subroutine the_genome::trait_init_genotype_gamma2gene (this, this_trait, g_p_matrix, init_val, gerror_cv, label)
 Initialise an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. More...
 
subroutine the_genome::trait_set_genotype_gamma2gene (this, this_trait, g_p_matrix, init_val, gerror_cv)
 Set an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. More...
 
The genotype to phenotype functions based on fixed linear

transformation.

subroutine the_genome::trait_init_linear_sum_additive_comps_2genes_r (this, this_trait, g_p_matrix, phenotype_min, phenotype_max, label)
 Initialise an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. More...
 
subroutine the_genome::trait_set_linear_sum_additive_comps_2genes_r (this, this_trait, g_p_matrix, phenotype_min, phenotype_max)
 Set an individual trait of the agent that depends on the genotype. This can be any trait upwards in the class hierarchy. More...
 

Variables

character(len= *), parameter, private the_genome::modname = "(THE_GENOME)"
 

Detailed Description

The Genome objects of 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_genome.f90.

Function/Subroutine Documentation

◆ qsort()

recursive pure subroutine chromosome_sort_rank_id::qsort ( type(gene), dimension(:), intent(inout)  A)

qsort and qs_partition_ are the two parts of the recursive sort algorithm qsort is the recursive frontend. Sorts genes within the chromosome by components of the array of alleles.

Parameters
[in,out]a[inout] input array to be sorted. It has the same type as the individual component objects of the array-object that we are going to sort.

Definition at line 334 of file m_genome.f90.

Here is the call graph for this function:

◆ qs_partition_rank_id()

pure subroutine chromosome_sort_rank_id::qs_partition_rank_id ( type(gene), dimension(:), intent(inout)  A,
integer, intent(out)  marker 
)

qsort and qs_partition_ are the two parts of the recursive sort algorithm qs_partition_rank_id is a pivot backend, here it sorts genes within the chromosome object by integer rank_id components of the genes.

Parameters
[in,out]a[inout] input array to be sorted.
[out]markerinternal pivot marker.
Note
Pivot point x, has the same type as the sorted object component.

Definition at line 355 of file m_genome.f90.

Here is the caller graph for this function: