Example #1
0
 def __init__(self, params_names: list):
     super(StochasticSEIRModel, self).__init__()
     self._parameters = se.SEIRParameters(params_names)
     # sets up n compartments, returns names of output variables
     # Define the names of the compartments to record - default all
     self._output_collector = se.StochasticOutputCollector(
         ['S', 'E', 'I', 'R'])
Example #2
0
    def __init__(self):
        super(DeterministicSEIRModel, self).__init__()

        # Assign default values
        self._output_collector = seirmo.SEIROutputCollector(
            ['S', 'E', 'I', 'R', 'Incidence'])
        self._parameters = seirmo.SEIRParameters(
            ['S0', 'E0', 'I0', 'R0', 'alpha', 'beta', 'gamma'])
Example #3
0
 def test_parameter_names(self):
     testSubject = se.SEIRParameters(['a', 'b'])
     self.assertEqual(['a', 'b'], testSubject.parameter_names())
Example #4
0
 def test_n_parameters(self):
     testSubject = se.SEIRParameters(['a', 'b'])
     self.assertEqual(2, testSubject.n_parameters())
Example #5
0
 def test__getitem__(self):
     testSubject = se.SEIRParameters(['a', 'b'])
     params = np.array([1, 2])
     testSubject.configure_parameters(params)
     for i in range(params.shape[0]):
         self.assertEqual(params[i], testSubject[i])
Example #6
0
 def test_configureParametersError(self):
     testSubject = se.SEIRParameters(['a', 'b'])
     with self.assertRaises(AssertionError):
         testSubject.configure_parameters(np.array([1, 2, 3]))
Example #7
0
 def test_configureParameters(self):
     testSubject = se.SEIRParameters(['a', 'b'])
     testSubject.configure_parameters(np.zeros((2, )))
Example #8
0
 def test__init__(self):
     se.SEIRParameters([])