Skip to contents

Vegetation is placed independently in each cell, without spatial structure.

Usage

pattern_random(veg_prob = 0.5)

Arguments

veg_prob

Numeric. Probability that each cell is vegetated (0-1, default: 0.5). Higher values give a denser vegetation cover.

Value

A named "landscape_params" list containing the supplied parameters.

Valid values and batch sampling

A single value fixes a parameter. A length-2 vector is a range, sampled once per landscape by create_landscapes and rejected by create_landscape. The table below shows for each parameter:

valid values that create_landscape accepts, and sampled ranges that create_landscapes draws from once per landscape for any parameter left unset. The defaults shown in Usage therefore apply to create_landscape only. Ranges that scale with landscape size are shown for the default 100 by 100.

ParameterValidSampled
veg_prob0 to 10.1 to 0.9

Examples

# A single landscape, with a fixed value
create_landscape("random", params = pattern_random(veg_prob = 0.3))
#> Landscape: <unnamed> [pattern: random]
#> -----------------------------------------
#> Dimensions: 100x100 (10000 cells)
#> Resolution: 1.0x1.0
#> Extent    : xmin=0.0, xmax=100.0, ymin=0.0, ymax=100.0
#> Values    : min=0.0, max=1.0
#> Parameters: width = 100, height = 100, veg_prob = 0.3 

# A batch, with veg_prob drawn from a range once per landscape
create_landscapes(
  n = 4,
  patterns = "random",
  params_list = list(random = pattern_random(veg_prob = c(0.2, 0.8)))
)
#>  Successfully generated all 4 training landscapes
#> $random_1
#> Landscape: "random_1" [pattern: random]
#> -----------------------------------------
#> Dimensions: 100x100 (10000 cells)
#> Resolution: 1.0x1.0
#> Extent    : xmin=0.0, xmax=100.0, ymin=0.0, ymax=100.0
#> Values    : min=0.0, max=1.0
#> Parameters: width = 100, height = 100, veg_prob = 0.279149282630533 
#> 
#> $random_2
#> Landscape: "random_2" [pattern: random]
#> -----------------------------------------
#> Dimensions: 100x100 (10000 cells)
#> Resolution: 1.0x1.0
#> Extent    : xmin=0.0, xmax=100.0, ymin=0.0, ymax=100.0
#> Values    : min=0.0, max=1.0
#> Parameters: width = 100, height = 100, veg_prob = 0.230016054306179 
#> 
#> $random_3
#> Landscape: "random_3" [pattern: random]
#> -----------------------------------------
#> Dimensions: 100x100 (10000 cells)
#> Resolution: 1.0x1.0
#> Extent    : xmin=0.0, xmax=100.0, ymin=0.0, ymax=100.0
#> Values    : min=0.0, max=1.0
#> Parameters: width = 100, height = 100, veg_prob = 0.468276544753462 
#> 
#> $random_4
#> Landscape: "random_4" [pattern: random]
#> -----------------------------------------
#> Dimensions: 100x100 (10000 cells)
#> Resolution: 1.0x1.0
#> Extent    : xmin=0.0, xmax=100.0, ymin=0.0, ymax=100.0
#> Values    : min=0.0, max=1.0
#> Parameters: width = 100, height = 100, veg_prob = 0.469204116333276 
#>