Skip to content

Commit e3699f9

Browse files
hatritannawendler
andauthored
1037 Extend test for equilibrium of IDE model (#1050)
The test checkProportionRecoveredDeath was extended: we now check if the compartments E,I,C,U and H are empty at the equilibrium Co-authored-by: annawendler <106674756+annawendler@users.noreply.github.com>
1 parent 604afb1 commit e3699f9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cpp/tests/test_ide_secir.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,17 @@ TEST(IdeSecir, checkProportionRecoveredDeath)
746746
// between Recovered and Dead is expected.
747747
EXPECT_TRUE(secihurd_simulated[Eigen::Index(tmax / dt - 1)] == secihurd_simulated[Eigen::Index(tmax / dt - 2)]);
748748

749+
// Check if the compartments E, C, I, H and U are almost empty at the equilibrium.
750+
EXPECT_NEAR(secihurd_simulated.get_last_value()[(Eigen::Index)mio::isecir::InfectionState::Exposed], 0, 1e-18);
751+
EXPECT_NEAR(secihurd_simulated.get_last_value()[(Eigen::Index)mio::isecir::InfectionState::InfectedNoSymptoms], 0,
752+
1e-8);
753+
EXPECT_NEAR(secihurd_simulated.get_last_value()[(Eigen::Index)mio::isecir::InfectionState::InfectedSymptoms], 0,
754+
1e-8);
755+
EXPECT_NEAR(secihurd_simulated.get_last_value()[(Eigen::Index)mio::isecir::InfectionState::InfectedSevere], 0,
756+
1e-8);
757+
EXPECT_NEAR(secihurd_simulated.get_last_value()[(Eigen::Index)mio::isecir::InfectionState::InfectedCritical], 0,
758+
1e-8);
759+
749760
// Check whether equilibrium has the right proportion between Recovered and Dead.
750761
EXPECT_NEAR((vec_prob[Eigen::Index(mio::isecir::InfectionTransition::InfectedCriticalToDead)] /
751762
vec_prob[Eigen::Index(mio::isecir::InfectionTransition::InfectedCriticalToRecovered)]) *

0 commit comments

Comments
 (0)