Skip to content

Commit

Permalink
Updates for Miles
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Sep 6, 2018
1 parent 2eb8a46 commit 3598a59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 6 additions & 4 deletions docs/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ objective we are setting! The objective sense, `Max` or `Min`, should be
provided as the second argument. Note also that we don't have a multiplication
`*` symbol between `5` and our variable `x` - Julia is smart enough to not need
it! Feel free to stick with `*` if it makes you feel more comfortable, as we
have done with `3 * y`:
have done with `3 * y`. (We have been intentionally inconsistent here to demonstrate different syntax; however, it is good practice to pick one way or the other consistently in your code.)
```jldoctest quickstart_example
julia> @objective(model, Max, 5x + 3 * y)
```
Expand All @@ -76,10 +76,12 @@ Adding constraints is a lot like setting the objective. Here we create a
less-than-or-equal-to constraint using `<=`, but we can also create equality
constraints using `==` and greater-than-or-equal-to constraints with `>=`:
```jldoctest quickstart_example; filter=r"≤|<="
julia> con = @constraint(model, 1x + 5y <= 3)
julia> @constraint(model, con, 1x + 5y <= 3)
x + 5 y <= 3.0
```
Note that we bind the constraint to the Julia variable `con` for later analysis.
Note that in a similar manner to the `@variable` macro, we have named the
constraint `con`. This will bind the constraint to the Julia variable `con` for
later analysis.

Models are solved with the `JuMP.optimize!` function:
```jldoctest quickstart_example
Expand Down Expand Up @@ -114,7 +116,7 @@ the `JuMP.termination_status` function:
julia> JuMP.termination_status(model)
Success::TerminationStatusCode = 0
```
In this case, `GLPK` returned `Success`. This does not mean that it has found
In this case, `GLPK` returned `Success`. This does *not* mean that it has found
the optimal solution. Instead, it indicates that GLPK has finished running and
did not encounter any errors or user-provided termination limits.

Expand Down
5 changes: 2 additions & 3 deletions docs/src/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ To reduce confusion, we will attempt, where possible, to always refer to
variables with their corresponding prefix.

!!! warn
If you create two JuMP variables with the same name, an error will be
thrown.
Creating two JuMP variables with the same name results in an error at runtime.

JuMP variables can have attributes, such as names or an initial primal start
value. We illustrate the name attribute in the following example:
Expand All @@ -70,7 +69,7 @@ decision variable
```

Because `y` is a Julia variable, we can bind it to a different value. For
example, if we go:
example, if we write:
```jldoctest variables
julia> y = 1
1
Expand Down

0 comments on commit 3598a59

Please sign in to comment.