def output_tax_revenue_chart(self): """ 各都市の税収グラフを出力 """ data = self.recorder.get_dataframe() path = "output/images/tax_revenue.png" title = "tax revenue" Visualizer.output_tax_revenue_chart(path, data, title=title)
def output_income_chart(self): """ 各都市誤との平均所得推移グラフを出力 """ data = self.recorder.get_dataframe() path = "output/images/avg_income.png" title = "average of income" Visualizer.output_income_chart(path, data, title=title)
def output_finance_chart(self): """ 各都市の経済力推移グラフを出力 """ data = self.recorder.get_dataframe() path = "output/images/finance.png" title = "finance" Visualizer.output_finance_chart(path, data, title=title)
def output_mental_strength_chart(self): """ 各都市ごとの平均メンタル値推移グラフを出力 """ data = self.recorder.get_dataframe() path = "output/images/avg_mental_strength.png" title = "average of mental strength" Visualizer.output_mental_strength_chart(path, data, title=title)
def output_outflow_chart(self): """ 各都市の流出者推移グラフを出力 """ data = self.recorder.get_dataframe() path = "output/images/outflow.png" title = "outflow" Visualizer.output_outflow_chart(path, data, title=title) path = "output/images/outflow_aggregated.png" title = "outflow (all environments)" Visualizer.output_outflow_chart(path, data, total=True, title=title)
def output_population_chart(self): """ 各都市の滞在者人口グラフを出力 """ data = self.recorder.get_dataframe() mode_list = ["total", "living", "death"] for mode in mode_list: path = "output/images/population_{}.png".format(mode) title = "population ({})".format(mode) Visualizer.output_population_chart( path, data, mode=mode, title=title )
def output_aggregated_seir_chart(self, title=None, estimator="mean"): """ 集計結果のSEIRチャートを出力 Parameters ---------- title : str, optional タイトル estimator : str, optional 集計方法(デフォルトは平均値) Noneを指定した場合は、全エピソードの結果を重ねてプロット """ logger.info("集計結果ラインチャートの出力を開始します estimator:{}".format(estimator)) s, e, i, r = self.recorder.get_simulation_seir() se, ee = self.recorder.get_emergency_date() path = "outputs/images/aggrigated-all.png" if estimator is not None: path = "outputs/images/aggrigated-{}.png".format(estimator) Visualizer.output_aggregated_seir_chart( self.episode_num, s, e, i, r, se, ee, path, title, estimator ) logger.info("集計結果ラインチャートを出力しました")
def output_infected_chart(self): """ 感染者推移に関するグラフを出力 """ data = self.recorder.get_dataframe() params = [True, False] for ( exposed, total, percentage, ) in itertools.product(params, repeat=3): path = "output/images/infected{}{}{}.png".format( "_and_exposed" if exposed else "", "_total" if total else "", "_percentage" if percentage else "", ) title = "infected{}{}{}".format( " + exposed" if exposed else "", " (all envs)" if total else "", " [%]" if percentage else "", ) Visualizer.output_infected_chart( path, data, exposed, total, percentage, title )
def output_hospital_patients_aggregated_chart( self, title=None, estimator="mean" ): """ 病院の患者数集計ラインチャートを出力 Parameters ---------- title : str, optional タイトル estimator : str, optional 集計方法(デフォルトは平均値) Noneを指定した場合は、全エピソードの結果を重ねてプロット """ logger.info("病院の患者数集計グラフの出力を開始します") p = self.recorder.get_simulation_patients() path = "outputs/images/patients-aggrigated-all.png" if estimator is not None: path = "outputs/images/patients-aggrigated-{}.png".format( estimator ) Visualizer.output_hospital_patients_aggregated_chart( self.episode_num, self.hospital_capacity, p, path, title, estimator ) logger.info("病院の患者数集計グラフを出力しました")