|
|
|
|
@ -426,13 +426,22 @@ def main():
|
|
|
|
|
eaf_v = 0
|
|
|
|
|
|
|
|
|
|
# rata-rata 3 tahun terakhir untuk net_capacity_factor
|
|
|
|
|
eaf_history.append(eaf_v)
|
|
|
|
|
cf_history.append(net_capacity_factor_v)
|
|
|
|
|
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)
|
|
|
|
|
if data["is_actual"] == 1:
|
|
|
|
|
eaf_history.append(eaf_v)
|
|
|
|
|
cf_history.append(net_capacity_factor_v)
|
|
|
|
|
net_capacity_factor = net_capacity_factor_v
|
|
|
|
|
eaf = eaf_v
|
|
|
|
|
else:
|
|
|
|
|
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:
|
|
|
|
|
production_bruto = validate_number(data["production_bruto"])
|
|
|
|
|
|