model:
sets:
method/1..17/:a,b,c;
way/1..3/:w;
link(method,way):x;
endsets
data:
x=2 0 0
1 1 0
1 0 1
0 2 0
0 1 2
0 0 3
3 0 0
2 1 0
2 0 2
1 2 1
1 1 2
1 0 3
0 4 0
0 3 1
0 2 2
0 1 3
0 0 5;
enddata
min=4*x1+4*x2+4*x3+4*x4+4*x5+4*x6+6*x7+6*x8+6*x9+6*x10+6*x11+6*x12+6*x13+6*x14+6*x15+6*x16+6*x17;
2*x1+x2+x3+3*x7+2*x8+2*x9+x10+x11+x12>=12000;
x2+2*x4+x5+x8+2*x10+x11+4*x13+3*x14+2*x15+x16>=16500;
x3+2*x5+3*x6+2*x9+x10+2*x11+3*x12+x14+2*x15+3*x16+5*x17>=8000;
x1+x2+x3+x4+x5+x6<=5000;
x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17<=9000;
@GIN(x1);@GIN(x2);@GIN(x3);@GIN(x4);@GIN(x5);@GIN(x6);@GIN(x7);@GIN(x8);@GIN(x9);@GIN(x10);@GIN(x11);@GIN(x12);@GIN(x13);@GIN(x14);@GIN(x15);@GIN(x16);@GIN(x17);
@if(x1#ne#0,1,0)+@if(x2#ne#0,1,0)+@if(x3#ne#0,1,0)+@if(x4#ne#0,1,0)+@if(x5#ne#0,1,0)+@if(x6#ne#0,1,0)+@if(x7#ne#0,1,0)+@if(x8#ne#0,1,0)+@if(x9#ne#0,1,0)+@if(x10#ne#0,1,0)+@if(x11#ne#0,1,0)+@if(x12#ne#0,1,0)+@if(x13#ne#0,1,0)+@if(x14#ne#0,1,0)+@if(x15#ne#0,1,0)+@if(x16#ne#0,1,0)+@if(x17#ne#0,1,0)=3;
end
以上是代码 ,
@if(x1#ne#0,1,0)+@if(x2#ne#0,1,0)+@if(x3#ne#0,1,0)+@if(x4#ne#0,1,0)+@if(x5#ne#0,1,0)+@if(x6#ne#0,1,0)+@if(x7#ne#0,1,0)+@if(x8#ne#0,1,0)+@if(x9#ne#0,1,0)+@if(x10#ne#0,1,0)+@if(x11#ne#0,1,0)+@if(x12#ne#0,1,0)+@if(x13#ne#0,1,0)+@if(x14#ne#0,1,0)+@if(x15#ne#0,1,0)+@if(x16#ne#0,1,0)+@if(x17#ne#0,1,0)=3;
这个是我想控制有且仅有3各变量不为0,在加入之前可以求出解,但是加上去后就报错 代码是203 193 不知道为什么 求大神指点
sets:
method/1..17/:a,b,c;
way/1..3/:w;
link(method,way):x;
endsets
data:
x=2 0 0
1 1 0
1 0 1
0 2 0
0 1 2
0 0 3
3 0 0
2 1 0
2 0 2
1 2 1
1 1 2
1 0 3
0 4 0
0 3 1
0 2 2
0 1 3
0 0 5;
enddata
min=4*x1+4*x2+4*x3+4*x4+4*x5+4*x6+6*x7+6*x8+6*x9+6*x10+6*x11+6*x12+6*x13+6*x14+6*x15+6*x16+6*x17;
2*x1+x2+x3+3*x7+2*x8+2*x9+x10+x11+x12>=12000;
x2+2*x4+x5+x8+2*x10+x11+4*x13+3*x14+2*x15+x16>=16500;
x3+2*x5+3*x6+2*x9+x10+2*x11+3*x12+x14+2*x15+3*x16+5*x17>=8000;
x1+x2+x3+x4+x5+x6<=5000;
x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17<=9000;
@GIN(x1);@GIN(x2);@GIN(x3);@GIN(x4);@GIN(x5);@GIN(x6);@GIN(x7);@GIN(x8);@GIN(x9);@GIN(x10);@GIN(x11);@GIN(x12);@GIN(x13);@GIN(x14);@GIN(x15);@GIN(x16);@GIN(x17);
@if(x1#ne#0,1,0)+@if(x2#ne#0,1,0)+@if(x3#ne#0,1,0)+@if(x4#ne#0,1,0)+@if(x5#ne#0,1,0)+@if(x6#ne#0,1,0)+@if(x7#ne#0,1,0)+@if(x8#ne#0,1,0)+@if(x9#ne#0,1,0)+@if(x10#ne#0,1,0)+@if(x11#ne#0,1,0)+@if(x12#ne#0,1,0)+@if(x13#ne#0,1,0)+@if(x14#ne#0,1,0)+@if(x15#ne#0,1,0)+@if(x16#ne#0,1,0)+@if(x17#ne#0,1,0)=3;
end
以上是代码 ,
@if(x1#ne#0,1,0)+@if(x2#ne#0,1,0)+@if(x3#ne#0,1,0)+@if(x4#ne#0,1,0)+@if(x5#ne#0,1,0)+@if(x6#ne#0,1,0)+@if(x7#ne#0,1,0)+@if(x8#ne#0,1,0)+@if(x9#ne#0,1,0)+@if(x10#ne#0,1,0)+@if(x11#ne#0,1,0)+@if(x12#ne#0,1,0)+@if(x13#ne#0,1,0)+@if(x14#ne#0,1,0)+@if(x15#ne#0,1,0)+@if(x16#ne#0,1,0)+@if(x17#ne#0,1,0)=3;
这个是我想控制有且仅有3各变量不为0,在加入之前可以求出解,但是加上去后就报错 代码是203 193 不知道为什么 求大神指点