Cizz22 3 months ago
parent baa5f1e264
commit 80e1dc87b3

@ -809,21 +809,21 @@ async def get_calculation_result(db_session: DbSession, calculation_id: str, tok
'critical_procurement_items': 0 'critical_procurement_items': 0
} }
plant_monthly_metrics = await plant_simulation_metrics(simulation_id=scope_calculation.rbd_simulation_id, location_tag="plant", use_location_tag=0, token=token, last_oh_date=prev_oh_scope.end_date, max_interval=scope_calculation.max_interval) # plant_monthly_metrics = await plant_simulation_metrics(simulation_id=scope_calculation.rbd_simulation_id, location_tag="plant", use_location_tag=0, token=token, last_oh_date=prev_oh_scope.end_date, max_interval=scope_calculation.max_interval)
REFERENCE_CAPACITY = 630 # or 550 # REFERENCE_CAPACITY = 630 # or 550
COST_PER_MWH = 1_000_000 # rupiah # COST_PER_MWH = 1_000_000 # rupiah
plant_capacity_loss_money = [metrics['derated_mwh'] * COST_PER_MWH for metrics in plant_monthly_metrics.values()] # 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) # # raise Exception(plant_monthly_metrics)
# Process each monthself # Process each monthself
for month_index in range(data_num): for month_index in range(data_num):
month_result = { month_result = {
"overhaul_cost": 0.0, "overhaul_cost": 0.0,
"corrective_cost": plant_capacity_loss_money[month_index], "corrective_cost": 0.0,
"procurement_cost": 0.0, "procurement_cost": 0.0,
"num_failures": 0.0, "num_failures": 0.0,
"day": month_index + 1, "day": month_index + 1,

Loading…
Cancel
Save