Skip to content

Commit

Permalink
Merge pull request #10 from AntaresSimulatorTeam/fix/milp_bug
Browse files Browse the repository at this point in the history
Fix/milp bug
  • Loading branch information
meslubi2021 authored Dec 22, 2024
2 parents c7014e6 + fe2a2c3 commit 421a994
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/solver/variable/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,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
/ 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 @@ -331,10 +335,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 @@ -349,8 +355,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

0 comments on commit 421a994

Please sign in to comment.