Skip to content
Snippets Groups Projects
Verified Commit b8891557 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Replace model parameter with global_model

parent 6fb83602
No related branches found
No related tags found
No related merge requests found
module Wait
import JuMP: Model, @constraint, @variable, VariableRef, owner_model, value
import JuMP: @constraint, @variable, VariableRef, value
import ..Variables: VariableType, variables, duration, get_free_variable
import ..BuildingBlocks: BuildingBlock, to_block
import ..BuildSequences: @global_model_constructor
import ..BuildSequences: global_model
import ...Scanners: Scanner
"""
......@@ -17,20 +17,16 @@ Duration can be set to one of:
- `nothing` to make it fully determined by external constraints and objectives
"""
struct WaitBlock <: BuildingBlock
model :: Model
duration :: VariableType
function WaitBlock(model::Model, duration=nothing)
function WaitBlock(duration=nothing)
res = new(
model,
get_free_variable(model, duration),
get_free_variable(duration),
)
@constraint model res.duration >= 0
return res
end
end
@global_model_constructor WaitBlock
"""
to_block(JuMP variable/:min or :max/nothing/number)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment