Produces an object suitable to pass as the ressupply to spec_rescomp().

ressupply_constant(rate)

Arguments

rate

A vector or rescomp_coefs_vector, with one number per resource. The supply rate of each resource.

Value

S3 object of class rescomp_ressupply.

Examples

ressupply <- ressupply_constant(c(0.2, 0.3))
get_ressupply(ressupply, c(2, 10), list())
#> [1] 0.2 0.3
get_ressupply(ressupply, c(5, 20), list()) # The same as above; constant supply doesn't depend on existing concentration.
#> [1] 0.2 0.3

ressupply <- ressupply_constant(rescomp_coefs_lerp(c(0.2, 0.3), c(0.4, 0.6), "extra_supply"))
get_ressupply(ressupply, c(2, 10), list(extra_supply = 0.2))
#> [1] 0.24 0.36
get_ressupply(ressupply, c(2, 10), list(extra_supply = 0.8))
#> [1] 0.36 0.54