| The OPTMODEL Procedure |
Name defines the name for the constraint. Use the name to
reference constraint attributes, such as the bounds, elsewhere in the
PROC OPTMODEL model. If no name is provided, then a default name is
created of the form _ACON_[
], where
is an
integer. See the section "Constraints" for more information.
Here is a simple example that defines a constraint with a lower bound:
proc optmodel;
var x, y;
number low;
con a: x+y >= low;
The following example adds an upper bound:
var x, y;
number low;
con a: low <= x+y <= low+10;
Indexed families of constraints can be defined by specifying an index-set after the name. Any dummy parameters that are declared in the index-set can be referenced in the expressions that define the constraint. A particular member of a indexed family can be specified using an identifier-expression with a bracketed index list, in the same fashion as array parameters and variables. For example, the following code creates an indexed family of constraints named incr:
proc optmodel;
number n;
var x{1..n}
/* require nondecreasing x values */
con incr{i in 1..n-1}: x[i+1] >= x[i];
The CON statement in the example creates constraints
incr[1] through incr[
1].
Constraint expressions cannot be defined using functions that return different values each time they are called. See the section "Indexing" for details.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.