get_divergence_factor: Allows the user to define the rate at which geographic...

View source: R/speciation.R

get_divergence_factorR Documentation

Allows the user to define the rate at which geographic clusters accumulate differentiation with each other.

Description

Allows the user to define the rate at which geographic clusters accumulate differentiation with each other.

Usage

get_divergence_factor(species, cluster_indices, landscape, config)

Arguments

species

the species of the current time step

cluster_indices

an index vector indicating the cluster every occupied site is part of

landscape

the landscape of the current time step

config

the config of the simulation

Details

This function determines the increase in divergence between separated clusters of a species. This function should return either (i) a single value if there is an homogeneous divergence, or (ii) a matrix indicating the divergence that should be accumulated between specific pairwise geographic clusters.

The function can either return a single value or a full cluster by cluster matrix. If only one value is returned it will be used to increment divergence between any given distinct cluster pairs. If a matrix is returned it has to be in the dimension of cluster x cluster, in which case the divergence values will be increased according to the cluster membership of any cell pairs.

For every time step, the divergence between geographic clusters can increase by a defined number. The divergence values can be scaled optionally using the species or landscape information. For instance, the divergence between clusters could be higher under warmer temperature, or difference in ecological traits could promote faster divergence between clusters.

Oppositely, for every time-step, if cluster are merged their divergence is reduced by one (1).

Value

a single value or a matrix of divergences between all clusters occurring in clusters_indices


gen3sis documentation built on Nov. 22, 2023, 5:07 p.m.