Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix milp bug #2489

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/solver/variable/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,17 @@ void State::yearEndBuildFromThermalClusterIndex(const uint clusterAreaWideIndex)
static_cast<uint>(
std::ceil(thermalClusterAvailableProduction
/ currentCluster->nominalCapacityWithSpinning))),
static_cast<uint>(std::ceil(thermalClusterProduction
/ currentCluster->nominalCapacityWithSpinning)));
static_cast<uint>(
std::ceil(std::round(thermalClusterProduction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

le ceil est-il nécessaire après l'arrondi?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui parce qu'en faisant le round sur des valeurs multipliées par 1000000 on obtient bien un nombre entier mais après on divise par 1000000 donc la valeur n'est pas entière. Le round est là pour arrondir à la 7ème décimale et non à un nombre entier

/ currentCluster->nominalCapacityWithSpinning * 1000000)
/ 1000000)));
}
else
{
ON_min[h] = static_cast<uint>(std::ceil(
thermalClusterProduction / currentCluster->nominalCapacityWithSpinning));
ON_min[h] = static_cast<uint>(
std::ceil(std::round(thermalClusterProduction
/ currentCluster->nominalCapacityWithSpinning * 1000000)
/ 1000000));
}
break;
}
Expand All @@ -330,10 +334,12 @@ void State::yearEndBuildFromThermalClusterIndex(const uint clusterAreaWideIndex)
{
ON_min[h] = std::max(
static_cast<uint>(
std::ceil(thermalClusterProduction / currentCluster->nominalCapacityWithSpinning)),
std::ceil(std::round(thermalClusterProduction
/ currentCluster->nominalCapacityWithSpinning * 1000000)
/ 1000000)),
thermalClusterDispatchedUnitsCountForYear[h]); // eq. to thermalClusterON for
// that hour

;
break;
}
case Antares::Data::UnitCommitmentMode::ucUnknown:
Expand All @@ -348,8 +354,9 @@ void State::yearEndBuildFromThermalClusterIndex(const uint clusterAreaWideIndex)

if (currentCluster->minStablePower > 0.)
{
maxUnitNeeded = static_cast<uint>(
std::floor(thermalClusterProduction / currentCluster->minStablePower));
maxUnitNeeded = static_cast<uint>(std::floor(
std::round(thermalClusterProduction / currentCluster->minStablePower * 1000000)
/ 1000000));
if (ON_max[h] > maxUnitNeeded)
{
ON_max[h] = maxUnitNeeded;
Expand Down
Loading