我有一个MIP模型,我想知道哪些约束是活跃的。
谢谢
答案 0 :(得分:0)
让我举个小例子:
dvar float+ Gas;
dvar float+ Chloride;
maximize
40 * Gas + 50 * Chloride;
subject to {
ctMaxTotal:
Gas + Chloride <= 50;
ctMaxTotal2:
3 * Gas + 4 * Chloride <= 180;
ctMaxChloride:
Chloride <= 40;
}
float slackCtMaxTotal=slack(ctMaxTotal);
float slackCtMaxTotal2=slack(ctMaxTotal2);
float slackCtMaxChloride=slack(ctMaxChloride);
execute
{
writeln("slack1= ",slackCtMaxTotal);
writeln("slack2= ",slackCtMaxTotal2);
writeln("slack3= ",slackCtMaxChloride);
}