永发信息网

关于ligo的sets编程问题

答案:1  悬赏:80  手机版
解决时间 2021-05-04 14:55
  • 提问者网友:谁的错
  • 2021-05-04 04:30

 

根据上面的方程 以及下面的流程图~  哪位高手帮我写下ligo的代码啊? 谢啦~~

最佳答案
  • 五星知识达人网友:野味小生
  • 2021-05-04 04:49
修改为这样:MODEL:sets:row/1..16/:;!这里n为控制参数;col/1..7/:;AZ(row,col):b,x;endsetsdata:b=1.754167,1.737500,1.737500,1.770833,1.770833,1.762500,1.762500,1.667500,1.609167,1.609167,1.650833,1.650833,1.659167,1.659167,1.396667,1.380000,1.380000,1.438333,1.438333,1.413333,1.413333,1.658333,1.633333,1.633333,1.658333,1.658333,1.658333,1.658333,1.546667,1.513333,1.513333,1.555000,1.555000,1.546667,1.546667,1.538333,1.496667,1.496667,1.480000,1.480000,1.505000,1.505000,1.562500,1.545833,1.545833,1.579167,1.579167,1.570833,1.570833,1.645833,1.604167,1.604167,1.637500,1.637500,1.637500,1.637500,1.670833,1.645833,1.645833,1.645833,1.645833,1.654167,1.654167,1.454167,1.420833,1.420833,1.412500,1.412500,1.420833,1.420833,1.463333,1.480000,1.480000,1.421667,1.421667,1.430000,1.430000,1.682500,1.690833,1.690833,1.699167,1.699167,1.690833,1.690833,1.466667,1.483333,1.483333,1.475000,1.475000,1.466667,1.466667,1.508333,1.500000,1.500000,1.466667,1.466667,1.475000,1.475000,1.552500,1.535833,1.535833,1.569167,1.569167,1.560833,1.560833,1.542500,1.509167,1.509167,1.550833,1.550833,1.542500, 1.542500;enddatamax=@sum(AZ(i,j): b(i,j)*x(i,j)); @for(col(j): @sum(row(i):x(i,j))<=2);@for(col(j):  @sum(row(i):x(i,j))>=1);@sum(AZ(i,j):x(i,j))=8;@for(row(i):  @sum(col(j):x(i,j))=1);@for(AZ(i,j): @bin(x(i,j)));这样理论上不会有错误,但可能有些版本会运行不出来,因为此模型的规模会超出某些版本的限制。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯