From 4e25f4c31b00ab7dbf1e5fef332ea145481f7144 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Mon, 14 Aug 2023 13:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A33=E7=94=B5=E7=AB=99=E9=92=B1?= =?UTF-8?q?=E4=B9=A6=E6=AF=94=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/riic_report_analysis.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/riic_report_analysis.py b/apps/riic_report_analysis.py index 4bd172b..61fca51 100644 --- a/apps/riic_report_analysis.py +++ b/apps/riic_report_analysis.py @@ -105,6 +105,8 @@ class RIICReportAnalysis: gold_avg = 0 exp_avg = 0 external_gold = 5000 + external_lmb = 43483 + external_exp = 36284 try: exp_list += [["manual", "0"]] * (len(date_list) - len(exp_list)) @@ -131,7 +133,9 @@ class RIICReportAnalysis: overflow_gold_by_e = gold_avg - balanced_gold_by_e more_exp_by_e = overflow_gold_by_e * 0.8 balanced_exp_by_e = exp_avg + more_exp_by_e - lmb_exp_ratio_by_e = (lmb_avg + 43483) / (balanced_exp_by_e + 36284) + lmb_exp_ratio_by_e = (lmb_avg + external_lmb) / ( + balanced_exp_by_e + external_exp + ) total_by_e = lmb_avg + balanced_exp_by_e gold_by_order = order_avg * 0.2 * 500 @@ -139,8 +143,8 @@ class RIICReportAnalysis: overflow_gold_by_order = gold_avg - balanced_gold_by_order more_exp_by_order = overflow_gold_by_order * 0.8 balanced_exp_by_order = exp_avg + more_exp_by_order - lmb_exp_ratio_by_order = (lmb_avg + 43483) / ( - balanced_exp_by_order + 36284 + lmb_exp_ratio_by_order = (lmb_avg + external_lmb) / ( + balanced_exp_by_order + external_exp ) total_by_order = lmb_avg + balanced_exp_by_order @@ -160,19 +164,18 @@ class RIICReportAnalysis: output += f"钱书比例:{lmb_exp_ratio_by_order:.2f}\n" output += f"调平总和:{total_by_order:.0f}\n\n" if power_plants == 3: - if exp_avg != 0: - output += f"钱书比例:{lmb_avg / exp_avg:.2f}" - else: - output += f"钱书比例:正无穷" + output += f"钱书比例:{(lmb_avg + external_lmb) / (exp_avg + external_exp):.2f}" else: balanced_gold = lmb_avg - external_gold overflow_gold = gold_avg - balanced_gold more_exp = overflow_gold * 0.8 balanced_exp = exp_avg + more_exp if power_plants == 2: - lmb_exp_ratio = (lmb_avg + 43483) / (balanced_exp + 36284) + lmb_exp_ratio = (lmb_avg + external_lmb) / ( + balanced_exp + external_exp + ) else: - lmb_exp_ratio = (lmb_avg + 43483) / (exp_avg + 36284) + lmb_exp_ratio = (lmb_avg + external_lmb) / (exp_avg + external_exp) total = lmb_avg + balanced_exp output += "====计算结果====\n"