diff --git a/src/wait.jl b/src/wait.jl index 039098e0063ce139e93e4cba424d59652444b948..f524116500453ed42d7784abb4843f617751549d 100644 --- a/src/wait.jl +++ b/src/wait.jl @@ -20,20 +20,18 @@ Duration can be set to one of: struct WaitBlock <: BuildingBlock model :: Model duration :: VariableType + function WaitBlock(model::Model, duration=nothing) + res = new( + model, + get_free_variable(model, duration), + ) + @constraint model res.duration >= 0 + return res + end end @global_model_constructor WaitBlock -function WaitBlock(model::Model, duration=nothing) - res = WaitBlock( - model, - get_free_variable(model, duration), - VariableType[] - ) - @constraint model duration(res) >= 0 - return res -end - """ to_block(JuMP variable/:min or :max/nothing/number)