ConditionalJuMP @implies将值设置为下限

时间:2018-08-21 12:36:22

标签: optimization julia mathematical-optimization julia-jump

我正在尝试使用ConditionalJuMP对JuMP中的某些变量(决策变量)执行简单的@implies操作。代码如下:

Assets = range(1,1,nAssets);
Tasks = range(1,1,nTasks);
# These are arbitrary. I wouldn't declare these if 
# ConditionalJuMP didn't require them
MAX_LB = -1000; 
MAX_UB = 1000;
@variables m begin
   MAX_LB <= X[Assets,Tasks] <= MAX_UB, Int
   MAX_LB <= XPrime[Assets,Tasks] <= MAX_UB, Int
end
for as in Assets, ts in Tasks
   @implies(m,(XPrime[as,ts] <= -1) => (X[as,ts] == 0))
   @implies(m,(XPrime[as,ts] >= 0) => (X[as,ts] == XPrime[as,ts]))
end

问题在于,使用ILOG OPL脚本与IBM CPLEX中的代码实现进行比较,就好像这些隐含语句不存在一样。如果我注释掉这些(@implies)语句,则CPLEX和Julia的输出完全相同。这使我相信我使用的功能不正确。

有什么想法吗?

0 个答案:

没有答案