Binary Integer Variables

A binary integer variable—also called a 0/1 variable—is a special case of an integer variable that is required to be either zero or one. It's often used as a switch to model Yes/No decisions.

The syntax of the @BIN function is:

@BIN( variable_name);

where variable_name is the name of the variable you wish to make binary. The @BIN function may be used in a model anywhere you would normally enter a constraint. The @BIN function can be embedded in an @FOR statement to allow you to easily set all, or selected, variables of an attribute to be binary integers. Some examples of @BIN are:

Example 1:        @BIN( X);

  makes the scalar variable X a binary integer,

Example 2:        @BIN( INCLUDE( 4));

  makes the variable INCLUDE( 4) binary,

Example 3:        @FOR( ITEMS: @BIN( INCLUDE));

  makes all variables in the INCLUDE attribute binary.