模型自己写 大概就是加一个0-1变量表示某个货物在某个舱内装的量 根据我的程序也可以写出
model:
sets:
carbin/1..3/:w,v;
goods/1..4/:weight,volumn,profit;
arrange(carbin,goods):x;
endsets
data:
w=10 16 18;
v=6800 8100 5300;
weight=18 15 23 12;
volumn=480 650 580 390;
profit=3100 2800 3500 2850;
enddata
max=@sum(goods(j):profit(j)*@sum(carbin(i):x(i,j)));
@for(carbin(i):@sum(goods(j):x(i,j))