Creates a data frame of resource constraints for the RAM model, allowing both upper ("<=``) and lower (">="`) bounds.

define_resources(resources, availability, direction)

Arguments

resources

Character vector of constraint/resource names (e.g., "land", "labor", "protein_min").

availability

Numeric vector of right-hand sides (amounts available or required).

direction

Character vector of constraint directions; each value must be either "<=" or ">=".

Value

Data frame with columns: resource, availability, and direction.

Examples

# Upper bounds only
define_resources(
  resources = c("land", "labor"),
  availability = c(100, 200),
  direction = c("<=", "<=")
)
#>   resource availability direction
#> 1     land          100        <=
#> 2    labor          200        <=

# Mixed upper/lower bounds (min requirement for protein, max for feed)
define_resources(
  resources = c("protein_min", "feed_max"),
  availability = c(2.5, 10),
  direction = c(">=", "<=")
)
#>      resource availability direction
#> 1 protein_min          2.5        >=
#> 2    feed_max         10.0        <=