hdavid16 / DisjunctiveProgramming.jl

A JuMP extension for Generalized Disjunctive Programming
MIT License
27 stars 3 forks source link

`@disjunction` macro requires a name to be passed to the disjunction #60

Closed hdavid16 closed 10 months ago

hdavid16 commented 1 year ago

When using a tuple to build a disjunction with @disjunction, a name must be provided or the transformation fails.

julia> fc1=Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER      
Solver name: No optimizer attached.       

julia> @variables(fc1,begin
       0 ≤ z ≤ 6
       0 ≤ x ≤ 3
       end)
julia> @disjunction(fc1, z==x+3, (z≤0,x≤0), reformulation=:big_m, M = 100)

ERROR: UndefVarError: disj_##638 not defined
Stacktrace:
 [1] top-level scope
   @ C:\Users\HD\.julia\packages\DisjunctiveProgramming\fJZjn\src\macros.jl:71      
hdavid16 commented 10 months ago

fixed in v0.4.0