Skip to content

Commit

Permalink
#101 Add tests for other voltages
Browse files Browse the repository at this point in the history
  • Loading branch information
VikasChidananda committed Sep 7, 2023
1 parent 74c7df9 commit 0c7f037
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions test/env_test_optimizer_status.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ CM = [
]


@testset "Optimizer status: FEASIBLE" begin
@testset "Optimizer status: FEASIBLE (Vrms = 230)" begin

parameters = PopulateParams(100e3, 0.95)

env = ElectricGridEnv(ts=0.0001, CM=CM, parameters=parameters, t_end=0.1, verbosity=2, action_delay=1)
env = ElectricGridEnv(ts=0.0001,
CM=CM,
parameters=parameters,
t_end=0.1,
verbosity=2,
action_delay=1)

@test ElectricGrid.optimizer_status["termination_status"] == LOCALLY_SOLVED #add other feasible enums from https://jump.dev/JuMP.jl/stable/moi/reference/models/#MathOptInterface.TerminationStatusCode
@test ElectricGrid.optimizer_status["primal_status"] == FEASIBLE_POINT # add other feasible status from above

end

@testset "Optimizer status: INFEASIBLE" begin
@testset "Optimizer status: INFEASIBLE (Vrms = 230)" begin

parameters = PopulateParams(230e3, 0.95)

Expand All @@ -34,3 +39,40 @@ end
@test ElectricGrid.optimizer_status["primal_status"] == INFEASIBLE_POINT # add other feasible status from above

end

# other volatges
@testset "Optimizer status: FEASIBLE (Vrms = 100)" begin

parameters = PopulateParams(100e2, 0.95, 100)

env = ElectricGridEnv(ts=0.0001,
CM=CM,
parameters=parameters,
t_end=0.1,
verbosity=2,
action_delay=1)

# @test
ElectricGrid.optimizer_status["termination_status"] == LOCALLY_SOLVED #add other feasible enums from https://jump.dev/JuMP.jl/stable/moi/reference/models/#MathOptInterface.TerminationStatusCode
@test ElectricGrid.optimizer_status["primal_status"] == FEASIBLE_POINT # add other feasible status from above

end


@testset "Optimizer status: INFEASIBLE (Vrms = 100)" begin

parameters = PopulateParams(100e3, 0.95, 100)

env = ElectricGridEnv(ts=0.0001,
CM=CM,
parameters=parameters,
t_end=0.1,
verbosity=2,
action_delay=1)

# @test
ElectricGrid.optimizer_status["termination_status"] == LOCALLY_INFEASIBLE #add other feasible enums from https://jump.dev/JuMP.jl/stable/moi/reference/models/#MathOptInterface.TerminationStatusCode
@test ElectricGrid.optimizer_status["primal_status"] == INFEASIBLE_POINT # add other feasible status from above

end

0 comments on commit 0c7f037

Please sign in to comment.