Skip to contents

Three-strategy replicator dynamics (cooperator C, defector / predator P, punisher / inspector O) swept across a grid in the (temptation T, inspection cost gamma) plane. Each grid point runs the replicator update to steady state and records the defector share as a "crime rate" proxy. Reproduces the qualitative phase diagram from D'Orsogna & Perc (2015) sec. 5 / Fig. 8.

Usage

morie_tps_inspection_game_phase(
  n_temptations = 20L,
  n_costs = 20L,
  n_steps = 600L,
  save_fig = TRUE,
  fig_dir = NULL
)

Arguments

n_temptations, n_costs

Grid resolution.

n_steps

Replicator iterations per grid point.

save_fig

Whether to write the phase-diagram PNG.

fig_dir

Directory to write the PNG into; NULL (the default) skips writing and says so in the result.

Value

A morie_rich_result containing the mean, min, max steady-state defector frequency across the grid, plus the resolution and step count used.

References

Helbing D, Szolnoki A, Perc M, Szabo G (2010). Punish, but not too hard. New Journal of Physics 12: 083005.

Examples

# \donttest{
  rr <- morie_tps_inspection_game_phase(
    n_temptations = 8L, n_costs = 8L, n_steps = 120L,
    save_fig = FALSE)
  print(rr$summary_lines)
#> $Method
#> [1] "3-strategy replicator dynamics (C, P, O)"
#> 
#> $Grid
#> [1] "8 x 8 (T, gamma)"
#> 
#> $Steps
#> [1] 120
#> 
#> $mean_crime_rate
#> [1] 0.23
#> 
#> $min_crime_rate
#> [1] 0
#> 
#> $max_crime_rate
#> [1] 0.786
#> 
#> $Figure
#> [1] "(skipped)"
#> 
# }