我需要使用LINGO确定8个变量之间的最小值.但我得到语法错误.谁能帮我做下面的模型?



大家好。我正在尝试使用LINGO开发一个Cut Order Planning模型

!有8个整数变量;x1 + x2 + x3 + x4 + x5和x6 + x7 +×8 & lt; = 16;

!Identify the values of the following variables:
y1 = 160/x1;
y2 = 448/x2;
y3 = 832/x3;
y4 = 1408/x4;
y5 = 896/x5;
y6 = 544/x6;
y7 = 320/x7;
y8 = 192 / x8;

!Determine the minimum variable with the lowest value:
min(y1, y2, y3, y4, y5, y6, y7, y8);

在Lingo脚本语言中,它可以写成:

MODEL:
SETS:
S  /1..8/: X,Y,D;
ENDSETS
DATA:
D = 160 488 832 1408 896 544 320 192;
ENDDATA
minimize = z;
@SUM(S(I): X(I)) <=16;
@FOR(S(I): 
Z>=Y(I);
Y(I) = D(I)/X(I);
@GIN(X(I));
);
END

使用"Solver|Generate|Display-Model"菜单项查看标量版本。

最新更新