1个回答
展开全部
声明一个整数变量用@GIN(变量名称);然后就可以做整数规划了。
加在前面(后面应该也可以),你先试试。
找了个例子
Model:
max=y1+y2+y3+y4+y5+1.5*y6-2.5*(300+x1-y1)-2*(x2-y2)-1.5*(x3-y3)-(x4-y4)-0.5*(x5-y5);
x1<=1200;
x2+x1-y1<=1200;
x3+x2-y2+x1-y1<=1200;
x4+x3-y3+x2-y2+x1-y1<=1200;
x5+x4-y4+x3-y3+x2-y2+x1-y1<=1200;
x6+x5-y5+x4-y4+x3-y3+x2-y2+x1-y1<=1200;
x6-y6+x5-y5+x4-y4+x3-y3+x2-y2+x1-y1>=0;
@gin(x1);@gin(x2);@gin(x3);@gin(x4);@gin(x5);@gin(x6);
@gin(y1);@gin(y2);@gin(y3);@gin(y4);@gin(y5);@gin(y6);
end
加在前面(后面应该也可以),你先试试。
找了个例子
Model:
max=y1+y2+y3+y4+y5+1.5*y6-2.5*(300+x1-y1)-2*(x2-y2)-1.5*(x3-y3)-(x4-y4)-0.5*(x5-y5);
x1<=1200;
x2+x1-y1<=1200;
x3+x2-y2+x1-y1<=1200;
x4+x3-y3+x2-y2+x1-y1<=1200;
x5+x4-y4+x3-y3+x2-y2+x1-y1<=1200;
x6+x5-y5+x4-y4+x3-y3+x2-y2+x1-y1<=1200;
x6-y6+x5-y5+x4-y4+x3-y3+x2-y2+x1-y1>=0;
@gin(x1);@gin(x2);@gin(x3);@gin(x4);@gin(x5);@gin(x6);
@gin(y1);@gin(y2);@gin(y3);@gin(y4);@gin(y5);@gin(y6);
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询