Skip to content

Commit 24c780c

Browse files
committed
Add a getting help section to the readme and flesh out the example
1 parent ff64414 commit 24c780c

1 file changed

Lines changed: 41 additions & 18 deletions

File tree

README.md

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# ParametricOptInterface.jl
22

3-
[![stable docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://jump.dev/ParametricOptInterface.jl/stable)
4-
[![development docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://jump.dev/ParametricOptInterface.jl/dev)
53
[![Build Status](https://github.com/jump-dev/ParametricOptInterface.jl/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jump-dev/ParametricOptInterface.jl/actions?query=workflow%3ACI)
64
[![Coverage](https://codecov.io/gh/jump-dev/ParametricOptInterface.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jump-dev/ParametricOptInterface.jl)
75

86
[ParametricOptInterface.jl](https://github.com/jump-dev/ParametricOptInterface.jl)
9-
is a package that adds parameters to models in JuMP and MathOptInterface.
7+
is a package for managing parameters in JuMP and MathOptInterface.
8+
9+
## Getting help
10+
11+
If you need help, please ask a question on the [JuMP community forum](https://jump.dev/forum).
12+
13+
If you have a reproducible example of a bug, please [open a GitHub issue](https://github.com/jump-dev/HiGHS.jl/issues/new).
1014

1115
## License
1216

@@ -24,27 +28,46 @@ Pkg.add("ParametricOptInterface")
2428

2529
## Documentation
2630

27-
The [documentation for ParametricOptInterface.jl](https://jump.dev/ParametricOptInterface.jl/stable/)
28-
includes a detailed description of the theory behind the package, along with
29-
examples, tutorials, and an API reference.
31+
See the [documentation for ParametricOptInterface.jl](https://jump.dev/ParametricOptInterface.jl),
32+
as well as [tutorials that use ParametricOptInterface](https://jump.dev/JuMP.jl/stable/tutorials/overview/#tutorial_ParametricOptInterface)
33+
in the JuMP documentation.
3034

3135
## Use with JuMP
3236

3337
Use ParametricOptInterface with JuMP by following this brief example:
3438

3539
```julia
36-
using JuMP, HiGHS
37-
import ParametricOptInterface as POI
38-
model = direct_model(POI.Optimizer(HiGHS.Optimizer))
39-
@variable(model, x)
40-
@variable(model, p in Parameter(1.0))
41-
@constraint(model, cons, x + p >= 3)
42-
@objective(model, Min, 2x)
43-
optimize!(model)
44-
@show value(x)
45-
set_parameter_value(p, 2.0)
46-
optimize!(model)
47-
@show value(x)
40+
julia> using JuMP, HiGHS
41+
42+
julia> import ParametricOptInterface as POI
43+
44+
julia> model = Model(() -> POI.Optimizer(HiGHS.Optimizer));
45+
46+
julia> set_silent(model)
47+
48+
julia> @variable(model, x)
49+
x
50+
51+
julia> @variable(model, p in Parameter(1))
52+
p
53+
54+
julia> @constraint(model, x + p >= 3)
55+
x + p 3
56+
57+
julia> @objective(model, Min, 2x)
58+
2 x
59+
60+
julia> optimize!(model)
61+
62+
julia> value(x)
63+
2.0
64+
65+
julia> set_parameter_value(p, 2.0)
66+
67+
julia> optimize!(model)
68+
69+
julia> value(x)
70+
1.0
4871
```
4972

5073
## GSOC2020

0 commit comments

Comments
 (0)