Cizz22 3 months ago
parent e1592de91f
commit 49fbda2340

@ -813,13 +813,13 @@ async def get_calculation_result(db_session: DbSession, calculation_id: str, tok
# seeing the implementation of the code, it is not possible to determine exactly what it is
# doing. It could be used to store monthly metrics for a plant, calculate metrics, or perform
# some other operation related to plant data.
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
COST_PER_MWH = 1_000_000 # rupiah
# REFERENCE_CAPACITY = 630 # or 550
# 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)
# 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)
# # raise Exception(plant_monthly_metrics)
@ -827,7 +827,7 @@ async def get_calculation_result(db_session: DbSession, calculation_id: str, tok
for month_index in range(data_num):
month_result = {
"overhaul_cost": 0.0,
"corrective_cost": cumulative_loss_money[month_index],
"corrective_cost": 0.0,
"procurement_cost": 0.0,
"num_failures": 0.0,
"day": month_index + 1,

Loading…
Cancel
Save