lingo中t是一个含有七个元素的数组,但只能在0.01,0.05,0.1这三个数中任取,怎么表示?

问题描述:

lingo中t是一个含有七个元素的数组,但只能在0.01,0.05,0.1这三个数中任取,怎么表示?

可以这样写sets:s1/1..7/:t;s2/1..3/:v;ss(s1,s2):x;endsetsdata:v=0.01 0.05 0.1;enddata@for(s1(i):t(i)=@sum(s2(j):v(j)*x(xi,j)));@for(s2(j):@sum(s1(i):x(i,j))=1);@for(ss:@bin(x));