Skip to content

Commit bc193fb

Browse files
committed
update docstring and kwarg types
1 parent 5097695 commit bc193fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/logic.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
"""
2-
choose!(m::Model, n::Int, vars::VariableRef...; mode)
2+
choose!(m::Model, n::Union{Int,VariableRef}, vars::VariableRef...; mode::Symbol=:exactly, name::String="")
33
44
Add constraint to select n elements from the list of variables. Options for mode
5-
are `:at_least`, `:at_most`, `:exactly`.
5+
are `:at_least`, `:at_most`, `:exactly`. Alternately, if `n` is a Binary variable,
6+
it becomes the RHS of the constraint. If `name` is provided, it will be converted
7+
to a Symbol and stored in the object dictionary.
68
"""
7-
function choose!(m::Model, n::Int, vars::VariableRef...; mode=:exactly, name="")
9+
function choose!(m::Model, n::Int, vars::VariableRef...; mode::Symbol=:exactly, name::String="")
810
@assert length(vars) >= n "Not enough variables passed."
911
@assert all(is_valid.(m, vars)) "Invalid VariableRefs passed."
1012
add_selection!(m, n, vars...; mode, name)
1113
end
12-
function choose!(m::Model, var::VariableRef, vars::VariableRef...; mode=:exactly, name="")
14+
function choose!(m::Model, var::VariableRef, vars::VariableRef...; mode::Symbol=:exactly, name::String="")
1315
@assert all(is_valid.(m, vcat(var,vars...))) "Invalid VariableRefs passed."
1416
add_selection!(m, var, vars...; mode, name)
1517
end

0 commit comments

Comments
 (0)