Skip to content

Commit

Permalink
Feature 102 extended unit tests (#126)
Browse files Browse the repository at this point in the history
* #101 Add tests for other voltages

* #45 extended tests

* delete `RL_tests`
  • Loading branch information
VikasChidananda authored Sep 29, 2023
1 parent 59515ed commit 652e655
Showing 1 changed file with 51 additions and 4 deletions.
55 changes: 51 additions & 4 deletions test/env_test_optimizer_status.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,71 @@ 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)

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_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

# 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
@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
@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 652e655

Please sign in to comment.