When a disjunct has no constraints assigned to it the following occurs:
@variable(m,x)
@variable(m,Y[1:2],Logical)
@constraint(m, x >= 0, Disjunct(Y[1]))
@disjunction(m,Y)
Error showing value of type DisjunctionRef{Model}:
ERROR: KeyError: key Y[2] not found
Stacktrace:
[1] getindex(h::Dict{LogicalVariableRef{Model}, Vector{Union{…}}}, key::LogicalVariableRef{Model})
@ Base ./dict.jl:498
[2] constraint_string(mode::MIME{Symbol("text/plain")}, d::Disjunction{Model})
@ DisjunctiveProgramming ~/Documents/DisjunctiveProgramming.jl/src/print.jl:112
We should either throw a meaningful error or handle the empty disjunct, which will be reformulated as if the variables in the disjunction were unrestricted (i.e., x is unbounded in the example above) or bounded by the variable bounds.
When a disjunct has no constraints assigned to it the following occurs:
We should either throw a meaningful error or handle the empty disjunct, which will be reformulated as if the variables in the disjunction were unrestricted (i.e.,
x
is unbounded in the example above) or bounded by the variable bounds.