0
给定一个模型目标函数,如何印出打印输出约束和使用Gurobi C#接口
- 所有添加的约束
- 其目标函数?
in C#?
说
GRBVar newVar=model.AddVar(0.0, 1.0, 0.0, GRB.BINARY, "newvar");
model.AddConstr(newVar<=1,"newConstraint");
model.SetObjective(newVar*2,GRB.MAXIMIZE);
//Printout all constraint in the model(suppose to be newVar<=1)
//Printout model objective function (suppose to be newVar*2)
如何实现什么是评论?谢谢。