Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Dec 11, 2024
1 parent d92689a commit c65785a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/solver/variable/economy/priceCSR.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#pragma once

#include "yuni/yuni.h"
#include "antares/logs/logs.h"
#include "../variable.h"

namespace Antares
Expand Down Expand Up @@ -241,14 +242,19 @@ class PriceCSR : public Variable::IVariable<PriceCSR<NextT>, NextT, VCardPriceCS
// after adq patch and DTG MRG netting UNSP. ENR CSR =/=0 ) MRG. PRICE CSR = MRG.
// PRICE_org (== “MRG. PRICE” before any adq patch IF after adq patch AND DTG MRG
// netting UNSP. ENR CSR = 0 )
if (Yuni::Math::Zero(
auto isLow = [](double x) { return ::fabs(x) < 1; };

if (isLow(
state.hourlyResults->ValeursHorairesDeDefaillancePositiveCSR[state.hourInTheWeek]))
{
pValuesForTheCurrentYear[numSpace][state.hourInTheYear]
= -state.hourlyResults->CoutsMarginauxHoraires[state.hourInTheWeek];
}
else
{
Antares::logs.notice()
<< state.area->name << " "
<< state.hourlyResults->ValeursHorairesDeDefaillancePositiveCSR[state.hourInTheWeek];
pValuesForTheCurrentYear[numSpace][state.hourInTheYear]
= state.area->thermal.unsuppliedEnergyCost;
}
Expand Down

0 comments on commit c65785a

Please sign in to comment.