Skip to content

Commit 3f167c0

Browse files
authored
prep for v0.6 (#131)
1 parent e7eed09 commit 3f167c0

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DisjunctiveProgramming"
22
uuid = "0d27d021-0159-4c7d-b4a7-9ccb5d9366cf"
33
authors = ["hdavid16 <[email protected]>"]
4-
version = "0.5.0"
4+
version = "0.6.0"
55

66
[deps]
77
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
@@ -30,4 +30,4 @@ Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
3030
Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
3131

3232
[targets]
33-
test = ["Aqua", "HiGHS", "Test", "Juniper", "Ipopt","InfiniteOpt"]
33+
test = ["Aqua", "HiGHS", "Test", "Juniper", "Ipopt", "InfiniteOpt"]

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Generalized Disjunctive Programming (GDP) extension to JuMP.
44

55
![logo](logo.png)
66

7-
[![codecov](https://codecov.io/gh/hdavid16/DisjunctiveProgramming.jl/graph/badge.svg?token=3FRPGMWF0J)](https://codecov.io/gh/hdavid16/DisjunctiveProgramming.jl)
7+
[![codecov](https://codecov.io/github/infiniteopt/DisjunctiveProgramming.jl/graph/badge.svg?token=z2CQwBiWzU)](https://codecov.io/github/infiniteopt/DisjunctiveProgramming.jl)
88
[![Docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://infiniteopt.github.io/DisjunctiveProgramming.jl/stable/)
99
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://infiniteopt.github.io/DisjunctiveProgramming.jl/dev/)
1010

@@ -192,7 +192,36 @@ The following reformulation methods are currently supported:
192192
- `final_reform_method`: Reformulation method to apply after cutting plane iterations. Default: `BigM()`.
193193
- `M_value`: Big-M value to use in the relaxed Big-M reformulation during iterations. Default: `1e9`.
194194

195+
## Infinite-Dimensional GDP
196+
To model disjunctions, logical variables, and logical constraints with infinite-dimensional optimization problems (e.g., dynamic and stochastic optimization), DisjunctiveProgramming is also compatible with [InfiniteOpt.jl](https://github.com/infiniteopt/InfiniteOpt.jl). For this, the syntax is largely the same, users simply need to import `InfiniteOpt` and use `InfiniteGDPModel`. They also can use `InfiniteLogical` to declare infinite logical variables as shown below:
197+
```julia
198+
using DisjunctiveProgramming, InfiniteOpt, HiGHS
199+
200+
# Create the model
201+
model = InfiniteGDPModel(HiGHS.Optimizer)
202+
203+
# Create the infinite variables
204+
I = 1:4
205+
@infinite_parameter(model, t ∈ [0, 1], num_supports = 100)
206+
@variable(model, 0 <= g[I] <= 10, Infinite(t))
207+
208+
# Add the disjunctions and their indicator variables
209+
@variable(model, G[I, 1:2], InfiniteLogical(t))
210+
@constraint(model, [i ∈ I, j ∈ 1:2], 0 <= g[i], Disjunct(G[i, 1]))
211+
@constraint(model, [i ∈ I, j ∈ 1:2], g[i] <= 0, Disjunct(G[i, 2]))
212+
@disjunction(model, [i ∈ I], G[i, :])
195213
214+
# Add the logical propositions
215+
@variable(model, W, InfiniteLogical(t))
216+
@constraint(model, G[1, 1] ∨ G[2, 1] ∧ G[3, 1] == W := true)
217+
@constraint(model, 𝔼(binary_variable(W), t) >= 0.95) # incorporate binary variable of logical variable in a nonlogical constraint
218+
219+
# Reformulate and solve
220+
optimize!(model, gdp_method = Hull())
221+
222+
# check the results
223+
value(W)
224+
```
196225

197226
## Release Notes
198227

0 commit comments

Comments
 (0)