From 7bbec544777dc35a0df1e7e7ea32eb625008453e Mon Sep 17 00:00:00 2001 From: Cizz22 Date: Mon, 13 Oct 2025 13:08:58 +0700 Subject: [PATCH] change k for exp risk cost --- src/calculation_time_constrains/service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calculation_time_constrains/service.py b/src/calculation_time_constrains/service.py index 88a6fab..6c0a6ed 100644 --- a/src/calculation_time_constrains/service.py +++ b/src/calculation_time_constrains/service.py @@ -825,11 +825,11 @@ async def get_calculation_result(db_session: DbSession, calculation_id: str, tok # 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) + total_simulation_period = int((plant_monthly_metrics['total_downtime'] + plant_monthly_metrics['total_uptime'])/720) - - loss_production_per_month = np.arange(0, scope_calculation.max_interval) - k = 4 - loss_exp = (plant_monthly_metrics['total_downtime'] * 660 * 500_000) * (np.exp(k * (loss_production_per_month / scope_calculation.max_interval)) - 1) / (np.exp(k) - 1) + loss_production_per_month = np.arange(0, total_simulation_period) + k = 5 + loss_exp = (plant_monthly_metrics['total_downtime'] * 660 * 500_000) * (np.exp(k * (loss_production_per_month / total_simulation_period)) - 1) / (np.exp(k) - 1) # REFERENCE_CAPACITY = 630 # or 550 # COST_PER_MWH = 1_000_000 # rupiah