mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 07:48:50 -06:00
Throw exception for infeasible models
This commit is contained in:
@@ -38,8 +38,7 @@ function solve(
|
|||||||
JuMP.optimize!(model)
|
JuMP.optimize!(model)
|
||||||
|
|
||||||
if !has_values(model)
|
if !has_values(model)
|
||||||
@warn "No solution available"
|
error("No solution available")
|
||||||
return OrderedDict()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if marginal_costs
|
if marginal_costs
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ end
|
|||||||
for (location_name, location_dict) in json["products"]["P1"]["initial amounts"]
|
for (location_name, location_dict) in json["products"]["P1"]["initial amounts"]
|
||||||
location_dict["amount (tonne)"] *= 1000
|
location_dict["amount (tonne)"] *= 1000
|
||||||
end
|
end
|
||||||
RELOG.solve(RELOG.parse(json))
|
@test_throws ErrorException("No solution available") RELOG.solve(RELOG.parse(json))
|
||||||
end
|
end
|
||||||
|
|
||||||
@testset "solve (with storage)" begin
|
@testset "solve (with storage)" begin
|
||||||
|
|||||||
Reference in New Issue
Block a user