Skip to content

Commit 335a13d

Browse files
committed
update readme and docstrings
1 parent a7f7064 commit 335a13d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ Disjunctions can be nested by passing an additional `Disjunct` tag. The Logical
107107

108108
Empty disjuncts are supported in GDP models. When used, the only constraints enforced on the model when the empty disjunct is selected are the global constraints and any other disjunction constraints defined.
109109

110+
For convenience, the `Exactly(1)` selector constraint is added by default when adding a disjunction to the model. In other words, `@disjunction(model, Y)` will add the disjunction and automatically add the logical constraint `Y in Exactly(1)`. For nested disjunctions, the appropriate `Exactly` constraint is added (e.g., `@constraint(model, Y[1:2] in Exactly(Y[3]))`) to indicate that `Exactly 1` logical variable in `Y[1:2]` is set to `true` when `Y[3]` is `true`, and both variables in `Y[1:2]` are set to `false` when `Y[3]` is `false`, meaning the parent disjunct is not selected. Adding the `Exactly` selector constraint by default can be disabled by setting the keyword argument `exclusive` to `false` in the `@disjunction` macro.
111+
110112
## MIP Reformulations
111113

112114
The following reformulation methods are currently supported:

src/macros.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ The recognized keyword arguments in `kw_args` are the following:
155155
the constraint names are set to `base_name[...]` for each index `...`
156156
of the axes `axes`.
157157
- `container`: Specify the container type.
158-
- `exclusive`: Specify a `Bool` whether an constraint should be added to make
159-
the disjuncts strictly exlcusive of one another.
158+
- `exclusive`: Specify a `Bool` whether a constraint should be added to
159+
only allow selecting one disjunct in the disjunction.
160160
161161
To create disjunctions without macros, see [`disjunction`](@ref).
162162
"""

src/reformulate.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ end
4949
"""
5050
requires_exclusive(method::AbstractReformulationMethod)
5151
52-
Return a `Bool` whether `method` requires an the disjuncts to be exactly exclusive
53-
for each disjunction (i.e., it requires an exactly one constraint). For new
54-
reformulation method types, this should be extended to in case such a constraint
55-
is required (defaults to `false` otherwise).
52+
Return a `Bool` whether `method` requires that `Exactly 1` disjunct be selected
53+
as true for each disjunction. For new reformulation method types, this should be
54+
extended to return `true` if such a constraint is required (defaults to `false` otherwise).
5655
"""
5756
requires_exclusive(::AbstractReformulationMethod) = false
5857

0 commit comments

Comments
 (0)