Parameters as Bounds
To use parameters as bounds you first need to define the parameters, then use them when defining the variable, By using defaults you only need to define bounds when necessary:
param lb {FEEDS} default 0; # Could use -Infinity here
param ub {FEEDS} default Infinity;
var Amount {f in FEEDS} >= lb[f] <= ub[f]; # Amount[f] >= 0 for all f by default
data;
param lb :=
GRAIN 1
;
param ub :=
GRAIN 10
PASTURE 6
;
# The amount of grain is between 1 and 10, the amoun tof pasture is <= 6, all amounts are >= 0
|