# NOT RUN {
# Example of cellular automata dispersal where the 2nd and 3rd life stages
# disperse up to a maximum of 100 cells but dispersal is affected by
# barriers (in this case roads). The road rasters have values of 0 for
# large roads (no dispersal across barrier) and 0.5 for smaller roads
# (reduced dispersal across barrier).
# }
# NOT RUN {
ca_dispersal <- cellular_automata_dispersal(max_cells = c(0, 100, 100), barriers = "roads")
ls <- landscape(population = egk_pop,
suitability = egk_hab,
carrying_capacity = egk_k,
"roads" = egk_road)
pd <- population_dynamics(change = growth(egk_mat),
dispersal = ca_dispersal,
density_dependence = ceiling_density())
simulation(landscape = ls, population_dynamics = pd, habitat_dynamics = NULL, timesteps = 20)
# }
Run the code above in your browser using DataLab