Y_Li
1
Hi, so this is my first time using JuMPChance, I have some questions regarding to setting variables in JuMPChance.
Below is my code
Blockquote
using JuMPChance
using JuMP
using Gurobi
var_para = [0.1 0.1 0.1]
m_chance=ChanceModel(solver=GurobiSolver())
@variable(m_chance, x[1:3])
@indepnormal(m_chance, z[i=1:3], mean=0, var=var_para[i])
@objective(m_chance, Min, sum{x[i], i=1:3})
@constraint(m_chance, z.*x >=-1, with_probability=0.95)
solve(m_chance,method=:Reformulate)
It returns “UndefVarError: undef not defined” while running the code. Could someone tell me which part went wrong please?
rdeits
2
undef
was introduced in Julia 0.7 and 1.0. Which Julia version are you using?
1 Like
jling
3
i don’t think JuMPChance support > Julia 0.4
Y_Li
4
This is Julia 0.6.
Jerry Ling via JuliaLang julialang@discoursemail.com 于 2019年8月2日周五 上午4:10写道:
Y_Li
5
Oh Thank you!
I’ll try to implement it on lower version.
Jerry Ling via JuliaLang julialang@discoursemail.com 于 2019年8月2日周五 上午4:10写道:
jling
6
no, you should switch to some package that support modern Julia
2 Likes
Y_Li
7
Thanks, do you have any suggestions about package that supports Chance constraint optimization?