mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
Fix all tests
This commit is contained in:
BIN
test/fixtures/case118-initcond.json.gz
vendored
BIN
test/fixtures/case118-initcond.json.gz
vendored
Binary file not shown.
@@ -12,7 +12,6 @@ using UnitCommitment, LinearAlgebra, Cbc, JuMP, JSON, GZip
|
||||
@test length(instance.units) == 6
|
||||
@test length(instance.contingencies) == 19
|
||||
@test length(instance.price_sensitive_loads) == 1
|
||||
@test length(instance.reserves2) == 1
|
||||
@test instance.time == 4
|
||||
|
||||
@test instance.lines[5].name == "l5"
|
||||
@@ -38,9 +37,9 @@ using UnitCommitment, LinearAlgebra, Cbc, JuMP, JSON, GZip
|
||||
@test instance.buses[9].load == [35.36638, 33.25495, 31.67138, 31.14353]
|
||||
@test instance.buses_by_name["b9"].name == "b9"
|
||||
|
||||
@test instance.reserves2[1].name == "r1"
|
||||
@test instance.reserves2[1].type == "spinning"
|
||||
@test instance.reserves2[1].amount == [100.0, 100.0, 100.0, 100.0]
|
||||
@test instance.reserves[1].name == "r1"
|
||||
@test instance.reserves[1].type == "spinning"
|
||||
@test instance.reserves[1].amount == [100.0, 100.0, 100.0, 100.0]
|
||||
@test instance.reserves_by_name["r1"].name == "r1"
|
||||
|
||||
unit = instance.units[1]
|
||||
@@ -54,7 +53,6 @@ using UnitCommitment, LinearAlgebra, Cbc, JuMP, JSON, GZip
|
||||
@test unit.min_power_cost == [1400.0 for t in 1:4]
|
||||
@test unit.min_uptime == 1
|
||||
@test unit.min_downtime == 1
|
||||
@test unit.provides_spinning_reserves == [true for t in 1:4]
|
||||
for t in 1:1
|
||||
@test unit.cost_segments[1].mw[t] == 10.0
|
||||
@test unit.cost_segments[2].mw[t] == 20.0
|
||||
@@ -89,7 +87,6 @@ using UnitCommitment, LinearAlgebra, Cbc, JuMP, JSON, GZip
|
||||
@test unit.min_power_cost == [0.0 for t in 1:4]
|
||||
@test unit.min_uptime == 1
|
||||
@test unit.min_downtime == 1
|
||||
@test unit.provides_spinning_reserves == [true for t in 1:4]
|
||||
for t in 1:4
|
||||
@test unit.cost_segments[1].mw[t] ≈ 33
|
||||
@test unit.cost_segments[2].mw[t] ≈ 33
|
||||
@@ -99,8 +96,7 @@ using UnitCommitment, LinearAlgebra, Cbc, JuMP, JSON, GZip
|
||||
@test unit.cost_segments[3].cost[t] ≈ 44.77853
|
||||
end
|
||||
@test length(unit.reserves) == 1
|
||||
|
||||
@test instance.reserves.spinning == zeros(4)
|
||||
@test unit.reserves[1].name == "r1"
|
||||
|
||||
@test instance.contingencies[1].lines == [instance.lines[1]]
|
||||
@test instance.contingencies[1].units == []
|
||||
|
||||
@@ -11,13 +11,12 @@ using UnitCommitment, LinearAlgebra, Cbc, JuMP, JSON, GZip
|
||||
# Should update all time-dependent fields
|
||||
@test modified.time == 2
|
||||
@test length(modified.power_balance_penalty) == 2
|
||||
@test length(modified.reserves.spinning) == 2
|
||||
@test length(modified.reserves_by_name["r1"].amount) == 2
|
||||
for u in modified.units
|
||||
@test length(u.max_power) == 2
|
||||
@test length(u.min_power) == 2
|
||||
@test length(u.must_run) == 2
|
||||
@test length(u.min_power_cost) == 2
|
||||
@test length(u.provides_spinning_reserves) == 2
|
||||
for s in u.cost_segments
|
||||
@test length(s.mw) == 2
|
||||
@test length(s.cost) == 2
|
||||
|
||||
Reference in New Issue
Block a user