plant/run2.py -> perbaikan rumus pengambilan 3 rata2 data terakhir, menjadi 3 terakhir sebelumnya -> last_3_eaf = eaf_history[-3:]

main
ariwahyunahar 2 weeks ago
parent d41899dcb5
commit 16faf36de4

@ -420,13 +420,22 @@ def main():
eaf_v = 0 eaf_v = 0
# rata-rata 3 tahun terakhir untuk net_capacity_factor # rata-rata 3 tahun terakhir untuk net_capacity_factor
eaf_history.append(eaf_v) if data["is_actual"] == 1:
cf_history.append(net_capacity_factor_v) eaf_history.append(eaf_v)
last_3_eaf = eaf_history[-4:-1] cf_history.append(net_capacity_factor_v)
last_3_cf = cf_history[-4:-1] net_capacity_factor = net_capacity_factor_v
avg_eaf_3 = sum(last_3_eaf) / len(last_3_eaf) if last_3_eaf else 0 eaf = eaf_v
avg_cf_3 = sum(last_3_cf) / len(last_3_cf) if last_3_cf else 0 else:
selisih_eaf_cf = abs(avg_cf_3 - avg_eaf_3) last_3_eaf = eaf_history[-3:]
last_3_cf = cf_history[-3:]
avg_eaf_3 = sum(last_3_eaf) / len(last_3_eaf) if last_3_eaf else 0
avg_cf_3 = sum(last_3_cf) / len(last_3_cf) if last_3_cf else 0
selisih_eaf_cf = abs(avg_cf_3 - avg_eaf_3)
eaf = eaf_v
net_capacity_factor = eaf_v - selisih_eaf_cf
eaf_history.append(eaf_v)
cf_history.append(net_capacity_factor)
if data["is_actual"] == 1: if data["is_actual"] == 1:
production_bruto = validate_number(data["production_bruto"]) production_bruto = validate_number(data["production_bruto"])
@ -441,8 +450,6 @@ def main():
cost_bd_om = validate_number(data["cost_bd_om"]) cost_bd_om = validate_number(data["cost_bd_om"])
cost_bd_pm_nonmi = validate_number(data["cost_bd_pm_nonmi"]) cost_bd_pm_nonmi = validate_number(data["cost_bd_pm_nonmi"])
cost_bd_bd = validate_number(data["cost_bd_bd"]) cost_bd_bd = validate_number(data["cost_bd_bd"])
net_capacity_factor = net_capacity_factor_v
eaf = eaf_v
else: else:
production_netto = net_capacity_factor * 8760 * daya_mampu_netto / 100 production_netto = net_capacity_factor * 8760 * daya_mampu_netto / 100
production_bruto = production_netto / (100 - (auxiliary + susut_trafo)) * 100 production_bruto = production_netto / (100 - (auxiliary + susut_trafo)) * 100
@ -461,8 +468,6 @@ def main():
cost_bd_om = cost_bd_om cost_bd_om = cost_bd_om
cost_bd_pm_nonmi = cost_bd_pm_nonmi cost_bd_pm_nonmi = cost_bd_pm_nonmi
cost_bd_bd = cost_bd_bd cost_bd_bd = cost_bd_bd
eaf = eaf_v
net_capacity_factor = eaf_v - selisih_eaf_cf
# ++++++ REVENUE +++++++ # ++++++ REVENUE +++++++
revenue_total = revenue_a + revenue_b + revenue_c + revenue_d revenue_total = revenue_a + revenue_b + revenue_c + revenue_d

Loading…
Cancel
Save