Skip to content

Commit 2502562

Browse files
committed
close #24
1 parent 2460400 commit 2502562

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/macros.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ function add_disjunction!(m::Model,disj...;reformulation::Symbol,M=missing,ϵ=1e
9393

9494
#apply reformulation
9595
if bin_var in keys(object_dictionary(m))
96-
@assert length(disj) <= length(m[bin_var]) "The disjunction name $bin_var is already registered in the model and its size is smaller than the number of disjunts. Specify new name."
96+
@assert m[bin_var] isa Vector{VariableRef} "The binary variable $bin_var is already registered in the model and is not of type Vector{VariableRef}. Specify a new name for the disjunction."
97+
@assert length(disj) <= length(m[bin_var]) "The binary variable $bin_var is already registered in the model and its size is smaller than the number of disjunts. Specify a new name for the disjunction."
9798
else
9899
#create indicator variable
99100
m[bin_var] = @variable(m, [eachindex(disj)], Bin, base_name = string(bin_var))

0 commit comments

Comments
 (0)