tapios / risk-networks

Code for risk networks: a blend of compartmental models, graphs, data assimilation and semi-supervised learning
Other
2 stars 2 forks source link

Infinite patient capacity #91

Closed glwagner closed 4 years ago

glwagner commented 4 years ago

The main purpose of this PR is to remove the field .patient_capacity from HealthService. The HealthService now has an infinite capacity. It also removes .waiting_list.

A few other changes are:

We have also changed printing for EpidemicSimulator and HealthService. Running examples/simple_epidemic.py now produces output like

                               *** Day: 2.500

[ Patient manifest ]          Admitted: 25237
                            Discharged: (3282, 'R')
                               Current: 8993, 5730, 25610, 29931, 4653, 18191, 8272, 25237, 4278, 7640, 20249, 7867

[ Status report ]          Susceptible: 28199
                               Exposed: 1136
                              Infected: 413
                          Hospitalized: 13
                             Resistant: 237
                              Deceased: 2
             Current possible contacts: 299739
               Current active contacts: 4497

[ Wall times ]    Hosp. administration: 0.0024 s,
                    Contact simulation: 1.4633 s,
                    Kinetic simulation: 3.1975 s

every static_contact_interval.

odunbar commented 4 years ago

regarding the set in what context were we getting duplicate entries? Was it when we search for hospital seeking nodes?

The other changes are fine - our model doesn't yet involve R->S as you note, so i am happy with the edges not being replaced.

glwagner commented 4 years ago

regarding the set in what context were we getting duplicate entries? Was it when we search for hospital seeking nodes?

We were not getting duplicate entries.

The point is that sets let us write

subset = large_group - group_to_ignore

which is simple. Sets do not allow duplicate entries, either. This is a downside if you expect to get duplicate entries. Since we don't expect duplicate entries, we can use sets.

The other changes are fine - our model doesn't yet involve R->S as you note, so i am happy with the edges not being replaced.

The point of the change is so that supporting this transition is possible (and also to make the function of the code more explicit).