关于优化软件 LINGO 的学习笔记

1. 对变量的取值范围界定函数

变量界定函数实现对变量取值范围的附加限制,Lingo中共4种:

@bin(x) 限制x为0或1

@bnd(L,x,U) 限制L≤x≤U

@free(x) 取消对变量x的默认下界为0的限制,即x可以取任意实数

@gin(x) 限制x为整数

在默认情况下,LINGO规定变量是非负的,也就是说下界为0,上界为+∞。@free取消了默认的下界为0的限制,使变量也可以取负值。@bnd用于设定一个变量的上下界,它也可以取消默认下界为0的约束。

 

Free Variables

By default, a LINGO variable has a lower bound of zero and an upper bound of infinity.@FREE removes the lower bound of zero and lets a variable take negative values, rendering it unconstrained in sign, or free. The syntax is:

@FREE(variable_name);

where variable_name is the name of the variable you wish to makefree.

The @FREE function may be used in a model anywhere you would normally enter a constraint. The @FREE function can be embedded in an@FOR statement to allow you to easily make all, or selected, variables of an attribute to befree. Some examples of@FREE are:

Example 1:@FREE( X);

makes the scalar variableXfree,

Example 2:@FREE( QUANTITY( 4));

makes the variableQUANTITY( 4)free,

Example 3:@FOR( ITEMS:@FREE( QUANTITY));

makes all variables in theQUANTITY attributefree.

2. ...

updating...

 

 

 

 

 

你可能感兴趣的:(LINGO,Lingo)