我的 c++/gurobi 文件出现错误:
错误代码 = 10004 无法检索属性“X”
我读到这可能与标签有关?但我看不出有什么问题。它适用于某些输入文件,但不适用于其他文件。所以我在附件中创建了一个玩具文件 t5.txt。此文件不起作用,但删除最后一列并将 8 设置为 7 可以修复它。我很纳闷...
下面是 model.write 的输出。一切似乎都有道理,任何想法我做错了什么?每当我做一个model.write(test.sol)时,程序就会停止,所以解决方案似乎有问题>
附件:main.cpp -> https://dl.dropboxusercontent.com/u/13564139/main.cpp
input.txt -> https://dl.dropboxusercontent.com/u/13564139/t5.txt
Maximize
15 student_has_projects4.1
Subject To
R0: student_has_projects0.0 + student_has_projects1.0
+ student_has_projects2.0 + student_has_projects3.0
+ student_has_projects4.0 + student_has_projects5.0
+ student_has_projects6.0 + student_has_projects7.0 <= 4
R1: student_has_projects1.0 + student_has_projects2.0 >= 1
R2: student_has_projects2.0 + 2 student_has_projects5.0 <= 2
R3: student_has_projects2.0 + 2 student_has_projects5.0 >= 1
R4: student_has_projects0.0 + student_has_projects3.0
+ student_has_projects4.0 + student_has_projects6.0
+ student_has_projects7.0 >= 1
R5: student_has_projects2.0 + student_has_projects5.0 <= 1
R6: student_has_projects0.1 + student_has_projects1.1
+ student_has_projects2.1 + student_has_projects3.1
+ student_has_projects4.1 + student_has_projects5.1
+ student_has_projects6.1 + student_has_projects7.1 <= 4
R7: student_has_projects1.1 + student_has_projects2.1 >= 1
R8: student_has_projects2.1 + 2 student_has_projects5.1 <= 2
R9: student_has_projects2.1 + 2 student_has_projects5.1 >= 1
R10: student_has_projects0.1 + student_has_projects3.1
+ student_has_projects4.1 + student_has_projects6.1
+ student_has_projects7.1 >= 1
R11: student_has_projects2.1 + student_has_projects5.1 <= 1
R12: student_has_projects0.2 + student_has_projects1.2
+ student_has_projects2.2 + student_has_projects3.2
+ student_has_projects4.2 + student_has_projects5.2
+ student_has_projects6.2 + student_has_projects7.2 <= 4
R13: student_has_projects1.2 + student_has_projects2.2 >= 1
R14: student_has_projects2.2 + 2 student_has_projects5.2 <= 2
R15: student_has_projects2.2 + 2 student_has_projects5.2 >= 1
R16: student_has_projects0.2 + student_has_projects3.2
+ student_has_projects4.2 + student_has_projects6.2
+ student_has_projects7.2 >= 1
R17: student_has_projects2.2 + student_has_projects5.2 <= 1
R18: student_has_projects0.0 + student_has_projects0.1
+ student_has_projects0.2 = 1
R19: student_has_projects1.0 + student_has_projects1.1
+ student_has_projects1.2 = 1
R20: student_has_projects2.0 + student_has_projects2.1
+ student_has_projects2.2 = 1
R21: student_has_projects3.0 + student_has_projects3.1
+ student_has_projects3.2 = 1
R22: student_has_projects4.0 + student_has_projects4.1
+ student_has_projects4.2 = 1
R23: student_has_projects5.0 + student_has_projects5.1
+ student_has_projects5.2 = 1
R24: student_has_projects6.0 + student_has_projects6.1
+ student_has_projects6.2 = 1
R25: student_has_projects7.0 + student_has_projects7.1
+ student_has_projects7.2 = 1
Bounds
Binaries
student_has_projects0.0 student_has_projects0.1 student_has_projects0.2
student_has_projects1.0 student_has_projects1.1 student_has_projects1.2
student_has_projects2.0 student_has_projects2.1 student_has_projects2.2
student_has_projects3.0 student_has_projects3.1 student_has_projects3.2
student_has_projects4.0 student_has_projects4.1 student_has_projects4.2
student_has_projects5.0 student_has_projects5.1 student_has_projects5.2
student_has_projects6.0 student_has_projects6.1 student_has_projects6.2
student_has_projects7.0 student_has_projects7.1 student_has_projects7.2
End