warnRelatives: Warning Relatives When Under Attack

Description Usage Arguments Value Examples

View source: R/attack.R

Description

Default function to govern behavior of warners under attack. Warner warns a specified number of the most closely-related individuals. May be used as an alternative function in which the values of warnable_relationship and dominant are specified.

Usage

1
2
3
warnRelatives(individuals, number_warned, warner_death_prob,
  nonwarner_death_prob, hider_death_prob, warnable_relationship, relMatrix,
  dominant = FALSE)

Arguments

individuals

Data frame containing id, sex, warner-status, mother id and father id. Value provided.

number_warned

Maximum number of individuals to warn. Value provided.

warner_death_prob

As in simulate. Value provided.

nonwarner_death_prob

As in simulate. Value provided.

hider_death_prob

As in simulate. Value provided.

warnable_relationship

Lowest allowed relationship-degree for an individual to be eligible for warning. Default version sets this to 0.25.

relMatrix

The current relationship matrix. Value provided.

dominant

If TRUE, individuals with 1 or more altruistic alleles can warn. Default version sets this to FALSE.

Value

A numerical vector of death probabilities in which the i^{\text{th}} element corresponds to row i of individuals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
pop <- simulate(sim_gens = 200,
                attack_behavior = list(
                  fn = warnRelatives,
                  args = list(
                    number_warned = 7,
                    warnable_relationship = 0.1,
                    dominant = TRUE)))

## End(Not run)

homerhanumat/simaltruist documentation built on May 25, 2019, 5:26 p.m.