|
|
|
|
@ -815,13 +815,15 @@ async def get_calculation_result(db_session: DbSession, calculation_id: str, tok
|
|
|
|
|
COST_PER_MWH = 1_000_000 # rupiah
|
|
|
|
|
|
|
|
|
|
plant_capacity_loss_money = [metrics['derated_mwh'] * COST_PER_MWH for metrics in plant_monthly_metrics.values()]
|
|
|
|
|
cumulative_loss_money = np.cumsum(plant_capacity_loss_money)
|
|
|
|
|
# cumulative_loss_money = np.cumsum(plant_capacity_loss_money)
|
|
|
|
|
|
|
|
|
|
# raise Exception(plant_monthly_metrics)
|
|
|
|
|
|
|
|
|
|
# Process each monthself
|
|
|
|
|
for month_index in range(data_num):
|
|
|
|
|
month_result = {
|
|
|
|
|
"overhaul_cost": 0.0,
|
|
|
|
|
"corrective_cost": cumulative_loss_money[month_index],
|
|
|
|
|
"corrective_cost": plant_capacity_loss_money[month_index],
|
|
|
|
|
"procurement_cost": 0.0,
|
|
|
|
|
"num_failures": 0.0,
|
|
|
|
|
"day": month_index + 1,
|
|
|
|
|
|