using JuMP, GLPK model = Model(GLPK.Optimizer) @variable(model, x[i=1:4]>= 0.5, Int) @objective(model, Min, sum(x)) optimize!(model) for x in all_variables(model) println("$(name(x)) = $(value(x))") end
As you know, run it in
Jupyter notebook, you can get the output like this:
x = 1.0 x = 1.0 x = 1.0 x = 1.0
and when you just input
x, you will get： x_1
So, I want to show my output like:
How to get these result with a simple code? And it will be the best if this result can be showed in REPL.
Thanks in advance!