Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit a212468

Browse files
committed
Typo fix: constate -> constant
1 parent e5787a6 commit a212468

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/solve.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function solvehook(m::Model; suppress_warnings=false, method=:Refomulate,lineari
6969
if cc.sense == :(<=)
7070
@constraint(m, ccexpr.constant <= 0)
7171
else
72-
@constraint(m, ccexpr.constate >= 0)
72+
@constraint(m, ccexpr.constant >= 0)
7373
end
7474
continue
7575
elseif all(ex -> isequal(ex, coeffs[1]), coeffs)

test/runtests.jl

+11
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,17 @@ end
193193
@test string(cc.twosidechanceconstr[end]) == "-1 <= (x)*ξ + 0 <= y[1] + y[2] + y[3], with probability 0.95"
194194
end
195195

196+
@testset "Non-chance constraint model" begin
197+
m = ChanceModel()
198+
@indepnormal(m, ξ, mean=0, var=1)
199+
@variable(m, x)
200+
@objective(m, Min, x)
201+
@constraint(m, JuMPChance.CCAffExpr() + x >= 0, with_probability = 0.5)
202+
status = solve(m, silent=true)
203+
@show status == :Optimal
204+
@show getvalue(x) 0.0 rtol=1e-6 atol=1e-6
205+
end
206+
196207
@testset "Basic chance constraint model" begin
197208
for method in [:Reformulate,:Cuts]
198209
m = ChanceModel()

0 commit comments

Comments
 (0)