-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatistics_seqird.py
33 lines (24 loc) · 1.01 KB
/
statistics_seqird.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from statistics.statistics_seiqr import StatisticsSEIQR
from logic.models import GenericModel
from logic.point import Point
class StatisticsSEIQRD(StatisticsSEIQR):
def __init__(self, model: GenericModel):
super().__init__(model)
self.deaths = 0
self.fieldnames += ["Deaths"]
self.save_field_names()
def reset_statistics(self) -> None:
super().reset_statistics()
self.deaths = 0
def update_statistics(self, point: Point) -> None:
super().update_statistics(point)
self.deaths += point.D
def get_attributes_array(self):
return super().get_attributes_array() + [self.deaths]
@property
def current_stats_representations(self) -> dict[str, str]:
stats_representations = {"deaths": f"deaths: {self.deaths}"}
stats_representations.update(super().current_stats_representations)
return stats_representations
def generate_plot(self, idx: int, *args) -> None:
super().generate_plot(idx, *args, 'Deaths')