diff --git a/src/variables.jl b/src/variables.jl index 39e87ef530c2a687f43dc0c195c991d9ebf50425..eca69ad10fcc28afddbcd0bf8f35bcaf5afbf6eb 100644 --- a/src/variables.jl +++ b/src/variables.jl @@ -423,6 +423,8 @@ Add a single constraint or objective to the `variable`. - `equation`: fix variable to the result of this equation """ apply_simple_constraint!(variable::AbstractVector, value::Symbol) = apply_simple_constraint!(sum(variable), Val(value)) +apply_simple_constraint!(variable, value::Nothing) = nothing +apply_simple_constraint!(variable::NamedTuple, value::Nothing) = nothing apply_simple_constraint!(variable::VariableType, value::Symbol) = apply_simple_constraint!(variable, Val(value)) apply_simple_constraint!(variable::VariableType, ::Val{:min}) = @objective global_model() Min objective_function(global_model()) + variable apply_simple_constraint!(variable::VariableType, ::Val{:max}) = @objective global_model() Min objective_function(global_model()) - variable