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

Allow setting :min/:max on vectors

parent d730642d
No related branches found
No related tags found
No related merge requests found
......@@ -322,6 +322,7 @@ Add a single constraint or objective to the `variable`.
- `equation`: fix variable to the result of this equation
"""
apply_simple_constraint!(variable, ::Nothing) = nothing
apply_simple_constraint!(variable::AbstractVector, value::Symbol) = apply_simple_constraint!(sum(variable), Val(value))
apply_simple_constraint!(variable, value::Symbol) = apply_simple_constraint!(variable, Val(value))
apply_simple_constraint!(variable, ::Val{:min}) = @objective global_model() Min objective_function(global_model()) + variable
apply_simple_constraint!(variable, ::Val{:max}) = @objective global_model() Min objective_function(global_model()) - variable
......
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