Exemple #1
0
def test_internalStateDiseaseUpdate_no_transitions():
    current_state = {("o", "E"): 100.0, ("o", "A"): 0.0}
    probs = {"o": {"E": {"E": 1.0}, "A": {"A": 1.0}}}

    new_state = np.internalStateDiseaseUpdate(current_state, probs)

    assert new_state == {("o", "E"): 100.0, ("o", "A"): 0.0}
Exemple #2
0
def test_internalStateDiseaseUpdate_progression_only():
    current_state = {("o", "S"): 100.0, ("o", "E"): 0.0}
    probs = {"o": {"S": {"E": 0.4, "S": 0.6}, "E": {"E": 1.0}}}

    new_state = np.internalStateDiseaseUpdate(current_state, probs)

    assert new_state == {("o", "S"): 100.0, ("o", "E"): 0.0}
def test_internalStateDiseaseUpdate_one_transition():
    current_state = {("o", "E"): 100.0, ("o", "A"): 0.0}
    probs = {"o": {"E": {"A": 0.4, "E": 0.6}, "A": {"A": 1.0}}}

    new_state = np.internalStateDiseaseUpdate(current_state, probs, False,
                                              None)

    assert new_state == {("o", "E"): 60.0, ("o", "A"): 40.0}