mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
Rename fix!(instance) to repair!
This commit is contained in:
@@ -8,14 +8,14 @@ parse_case14() = JSON.parse(GZip.gzopen("../instances/test/case14.json.gz"),
|
||||
dicttype=()->DefaultOrderedDict(nothing))
|
||||
|
||||
@testset "Validation" begin
|
||||
@testset "fix!" begin
|
||||
@testset "repair!" begin
|
||||
|
||||
@testset "Cost curve should be convex" begin
|
||||
json = parse_case14()
|
||||
json["Generators"]["g1"]["Production cost curve (MW)"] = [100, 150, 200]
|
||||
json["Generators"]["g1"]["Production cost curve (\$)"] = [10, 25, 30]
|
||||
instance = UnitCommitment.from_json(json, fix=false)
|
||||
@test UnitCommitment.fix!(instance) == 4
|
||||
instance = UnitCommitment.from_json(json, repair=false)
|
||||
@test UnitCommitment.repair!(instance) == 4
|
||||
end
|
||||
|
||||
@testset "Startup limit must be greater than Pmin" begin
|
||||
@@ -23,16 +23,16 @@ parse_case14() = JSON.parse(GZip.gzopen("../instances/test/case14.json.gz"),
|
||||
json["Generators"]["g1"]["Production cost curve (MW)"] = [100, 150]
|
||||
json["Generators"]["g1"]["Production cost curve (\$)"] = [100, 150]
|
||||
json["Generators"]["g1"]["Startup limit (MW)"] = 80
|
||||
instance = UnitCommitment.from_json(json, fix=false)
|
||||
@test UnitCommitment.fix!(instance) == 1
|
||||
instance = UnitCommitment.from_json(json, repair=false)
|
||||
@test UnitCommitment.repair!(instance) == 1
|
||||
end
|
||||
|
||||
@testset "Startup costs and delays must be increasing" begin
|
||||
json = parse_case14()
|
||||
json["Generators"]["g1"]["Startup costs (\$)"] = [300, 200, 100]
|
||||
json["Generators"]["g1"]["Startup delays (h)"] = [8, 4, 2]
|
||||
instance = UnitCommitment.from_json(json, fix=false)
|
||||
@test UnitCommitment.fix!(instance) == 4
|
||||
instance = UnitCommitment.from_json(json, repair=false)
|
||||
@test UnitCommitment.repair!(instance) == 4
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user