mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
Reformat source code
This commit is contained in:
@@ -3,37 +3,33 @@
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
using UnitCommitment, Cbc, HiGHS, JuMP
|
||||
import UnitCommitment:
|
||||
AELMP
|
||||
import UnitCommitment: AELMP
|
||||
|
||||
@testset "aelmp" begin
|
||||
path = "$FIXTURES/aelmp_simple.json.gz"
|
||||
# model has to be solved first
|
||||
instance = UnitCommitment.read(path)
|
||||
model = UnitCommitment.build_model(
|
||||
instance=instance,
|
||||
optimizer=Cbc.Optimizer,
|
||||
instance = instance,
|
||||
optimizer = Cbc.Optimizer,
|
||||
variable_names = true,
|
||||
)
|
||||
JuMP.set_silent(model)
|
||||
UnitCommitment.optimize!(model)
|
||||
|
||||
# policy 1: allow offlines; consider startups
|
||||
aelmp_1 = UnitCommitment.compute_lmp(
|
||||
model,
|
||||
AELMP(),
|
||||
optimizer=HiGHS.Optimizer
|
||||
)
|
||||
aelmp_1 =
|
||||
UnitCommitment.compute_lmp(model, AELMP(), optimizer = HiGHS.Optimizer)
|
||||
@test aelmp_1["B1", 1] ≈ 231.7 atol = 0.1
|
||||
|
||||
# policy 2: do not allow offlines; but consider startups
|
||||
aelmp_2 = UnitCommitment.compute_lmp(
|
||||
model,
|
||||
model,
|
||||
AELMP(
|
||||
allow_offline_participation=false,
|
||||
consider_startup_costs=true
|
||||
allow_offline_participation = false,
|
||||
consider_startup_costs = true,
|
||||
),
|
||||
optimizer=HiGHS.Optimizer
|
||||
optimizer = HiGHS.Optimizer,
|
||||
)
|
||||
@test aelmp_2["B1", 1] ≈ 274.3 atol = 0.1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ function solve_lmp_testcase(path::String)
|
||||
lmp = UnitCommitment.compute_lmp(
|
||||
model,
|
||||
ConventionalLMP(),
|
||||
optimizer=HiGHS.Optimizer,
|
||||
optimizer = HiGHS.Optimizer,
|
||||
)
|
||||
return lmp
|
||||
end
|
||||
@@ -48,4 +48,4 @@ end
|
||||
@test lmp["A", 1] == 50.0
|
||||
@test lmp["B", 1] == 70.0
|
||||
@test lmp["C", 1] == 90.0
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user