Expressions

Numeric Expressions

Statements

Parameter Declaration

param name [domain][, := value];

nameidentifier of the parameter
domainoptional indexing expression
attriboptional attributes seperated by commas

Allowable attributes are

:= expressionexpression defining the value of the parameter

Examples

param a;
param b := 5;
param c {I};
param d {j in J} := 2 * j;

Set Declaration

set name [domain][[, attrib]];

nameidentifier of the set
domainoptional indexing expression
attriboptional attributes seperated by commas

Allowable attributes are

dimen ndimension of the tuples of the set
:= expressionexpression defining the tuples of the set

Examples

set I;
set J := {1..10};
set K, dimen 2 := {(0, 0), (0, 1), (1,0), (1, 1)};
set L {i in I} := {1..i};

Variable Declaration

var name [domain][[, attrib]];

nameidentifier of the variable
domainoptional indexing expression
attriboptional attributes seperated by commas

Allowable attributes are

binaryvariable can only take value 0 or 1
>= expressionlower bound
<= expressionupper bound
= expressioninitial value

Examples

var v;
var w, binary, = 1;
var x {I}, >=0, <= 2;
var y {j in J}, = 2 * j;

Objective

minimize name : expression;

maximize name : expression;

nameidentifier of the objective
expressionexpression to be minimized or maximized

Examples

var x;
minimize ( x - 1 ) * x;