Skip to content

Commit

Permalink
Release v8.8.11 + ANT-2295 (#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilpier-code authored Nov 18, 2024
1 parent 827a7f2 commit 5644fe4
Show file tree
Hide file tree
Showing 32 changed files with 1,403 additions and 506 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ jobs:
batch-name: valid-mps
os: ${{ env.os }}

- name: Run tests on adequacy patch
if: ${{ env.RUN_SIMPLE_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: adequacy-patch-CSR
os: ${{ env.test-platform }}

- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ jobs:
batch-name: valid-mps
os: ${{ env.test-platform }}

- name: Run tests on adequacy patch
if: ${{ env.RUN_SIMPLE_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: adequacy-patch-CSR
os: ${{ env.test-platform }}


- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
Expand Down
9 changes: 9 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Antares Changelog
=================

## New features
* Adding parameters for the used optimization solver [ANT-2280] (#2466)
* Adequacy patch CSR : add out variables after DTG netting step [ANT-2295] (#2472)

## Bugfix
* Legacy GUI : Restore and fix grid statistics [ANT-2381] (#2478)
* Don't apply reverse spinning if the cluster is no force gen [ANT-2293] (#2468)
* Use "trigerred" criterion for mrg price [ANT-2294] (#2453)

8.8.10 (09/2024)
--------------------
## Bugfix (adequacy patch)
Expand Down
2 changes: 1 addition & 1 deletion simtest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v8.8.7"
"version": "v8.8.11a"
}
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14) # FetchContent_MakeAvailable
# Version
set(ANTARES_VERSION_HI 8)
set(ANTARES_VERSION_LO 8)
set(ANTARES_VERSION_REVISION 10)
set(ANTARES_VERSION_REVISION 11)

# Beta release
set(ANTARES_BETA 0)
Expand Down
5 changes: 4 additions & 1 deletion src/libs/antares/study/parameters/adq-patch-params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,13 @@ void AdqPatchParams::addExcludedVariables(std::vector<std::string>& out) const
out.emplace_back("LMR VIOL.");
out.emplace_back("UNSP. ENRG CSR");
out.emplace_back("DTG MRG CSR");
out.emplace_back("LOLD CSR");
out.emplace_back("LOLP CSR");
out.emplace_back("MAX MRG CSR");
out.emplace_back("OV. COST CSR");
}
}


bool AdqPatchParams::updateFromKeyValue(const Yuni::String& key, const Yuni::String& value)
{
if (key == "include-adq-patch")
Expand Down
14 changes: 4 additions & 10 deletions src/solver/optimisation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ set(RTESOLVER_OPT
adequacy_patch_csr/hourly_csr_problem.h
adequacy_patch_csr/adq_patch_post_process_list.h
adequacy_patch_csr/adq_patch_post_process_list.cpp
adequacy_patch_csr/post_processing.cpp
adequacy_patch_csr/post_processing.h

adequacy_patch_local_matching/adq_patch_local_matching.h
adequacy_patch_local_matching/adq_patch_local_matching.cpp
adequacy_patch_csr/adq_patch_curtailment_sharing.h
adequacy_patch_csr/adq_patch_curtailment_sharing.cpp
adequacy_patch_csr/solve_problem.h
adequacy_patch_csr/solve_problem.cpp
adequacy_patch_csr/set_variable_boundaries.cpp
adequacy_patch_csr/set_problem_cost_function.cpp
Expand Down Expand Up @@ -170,15 +170,9 @@ set(RTESOLVER_OPT
constraints/ExchangeBalance.h
constraints/ExchangeBalance.cpp
constraints/ExchangeBalanceGroup.h
constraints/ExchangeBalanceGroup.cpp

)

constraints/ExchangeBalanceGroup.cpp)


set(SRC_MODEL
${RTESOLVER_OPT}
)
set(SRC_MODEL ${RTESOLVER_OPT})

add_library(model_antares ${SRC_MODEL})
if(NOT MSVC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

#include "adq_patch_curtailment_sharing.h"
#include "../opt_fonctions.h"
#include "solve_problem.h"
#include "csr_quadratic_problem.h"
#include "count_constraints_variables.h"
#include "../simulation/adequacy_patch_runtime_data.h"
Expand Down Expand Up @@ -138,7 +138,7 @@ void HourlyCSRProblem::calculateCsrParameters()
double spillageInit
= problemeHebdo_->ResultatsHoraires[Area].ValeursHorairesDeDefaillanceNegative[hour];

rhsAreaBalanceValues[Area] = ensInit + netPositionInit - spillageInit;
rhsAreaBalanceValues_[Area] = ensInit + netPositionInit - spillageInit;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP
problemeHebdo_, areas, sheddingPolicy, splxOptimization, thread_number));
post_process_list.push_back(std::make_unique<CurtailmentSharingPostProcessCmd>(
adqPatchParams, problemeHebdo_, areas, thread_number_));
// Here a post process particular to adq patch
post_process_list.push_back(std::make_unique<DTGmarginForAdqPatchPostProcessCmd>(
adqPatchParams, problemeHebdo_, areas, thread_number));
post_process_list.push_back(std::make_unique<UpdateMrgPriceAfterCSRcmd>(problemeHebdo_,
areas,
thread_number));
post_process_list.push_back(std::make_unique<DTGnettingAfterCSRcmd>(
problemeHebdo_, areas, thread_number));
post_process_list.push_back(
std::make_unique<HydroLevelsUpdatePostProcessCmd>(problemeHebdo_, areas, true, false));
post_process_list.push_back(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void HourlyCSRProblem::setRHSnodeBalanceValue()
if (it != numberOfConstraintCsrAreaBalance.end())
{
int Cnt = it->second;
problemeAResoudre_.SecondMembre[Cnt] = rhsAreaBalanceValues[Area];
problemeAResoudre_.SecondMembre[Cnt] = rhsAreaBalanceValues_[Area];
logs.debug() << Cnt << ": Area Balance: RHS[" << Cnt
<< "] = " << problemeAResoudre_.SecondMembre[Cnt]
<< " (Area = " << Area << ")";
Expand Down
120 changes: 60 additions & 60 deletions src/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,68 @@
#include <antares/study/parameters/adq-patch-params.h>
#include "../opt_structure_probleme_a_resoudre.h"



struct LinkVariable
{
LinkVariable() : directVar(-1), indirectVar(-1)
{
}
LinkVariable(int direct, int indirect) : directVar(direct), indirectVar(indirect)
{
}
inline bool check() const
{
if (directVar < 0)
Antares::logs.warning() << "directVar < 0 detected, this should not happen";
if (indirectVar < 0)
Antares::logs.warning() << "indirectVar < 0 detected, this should not happen";

return (directVar >= 0) && (indirectVar >= 0);
}
int directVar;
int indirectVar;
};

struct PROBLEME_HEBDO;
class HourlyCSRProblem
{
using AdqPatchParams = Antares::Data::AdequacyPatch::AdqPatchParams;
public:
~HourlyCSRProblem() = default;

HourlyCSRProblem(const HourlyCSRProblem&) = delete;
HourlyCSRProblem& operator=(const HourlyCSRProblem&) = delete;
explicit HourlyCSRProblem(const AdqPatchParams& adqPatchParams,PROBLEME_HEBDO* p) :
adqPatchParams_(adqPatchParams),
problemeHebdo_(p)
{
double temp = pow(10, -adqPatchParams.curtailmentSharing.thresholdVarBoundsRelaxation);
belowThisThresholdSetToZero = std::min(temp, 0.1);

allocateProblem();
}

inline void setHour(int hour)
{
triggeredHour = hour;
}

void run(uint week, uint year);

public:
// TODO [gp] : try to make these members private
double belowThisThresholdSetToZero;
std::set<int> varToBeSetToZeroIfBelowThreshold; // place inside only ENS and Spillage variable
int triggeredHour;
std::set<int> ensVariablesInsideAdqPatch; // place inside only ENS inside adq-patch
// links between two areas inside the adq-patch domain
std::map<int, LinkVariable> linkInsideAdqPatch;
std::map<int, int> numberOfConstraintCsrAreaBalance;
std::map<int, int> numberOfConstraintCsrFlowDissociation;
std::map<int, int> numberOfConstraintCsrHourlyBinding; // length is number of binding constraint
// contains interco 2-2

private:
void calculateCsrParameters();

Expand Down Expand Up @@ -68,69 +127,10 @@ class HourlyCSRProblem
void setLinearCost();

private:
using AdqPatchParams = Antares::Data::AdequacyPatch::AdqPatchParams;
const AdqPatchParams& adqPatchParams_;

public:
void run(uint week, uint year);

// TODO[FOM] Make these members private
int triggeredHour;
double belowThisThresholdSetToZero;
PROBLEME_HEBDO* problemeHebdo_;
PROBLEME_ANTARES_A_RESOUDRE problemeAResoudre_;

explicit HourlyCSRProblem(const AdqPatchParams& adqPatchParams,PROBLEME_HEBDO* p) :
adqPatchParams_(adqPatchParams),
problemeHebdo_(p)
{
double temp = pow(10, -adqPatchParams.curtailmentSharing.thresholdVarBoundsRelaxation);
belowThisThresholdSetToZero = std::min(temp, 0.1);

allocateProblem();
}

~HourlyCSRProblem() = default;

HourlyCSRProblem(const HourlyCSRProblem&) = delete;
HourlyCSRProblem& operator=(const HourlyCSRProblem&) = delete;

inline void setHour(int hour)
{
triggeredHour = hour;
}

std::map<int, int> numberOfConstraintCsrEns;
std::map<int, int> numberOfConstraintCsrAreaBalance;
std::map<int, int> numberOfConstraintCsrFlowDissociation;
std::map<int, int> numberOfConstraintCsrHourlyBinding; // length is number of binding constraint
// contains interco 2-2

std::map<int, double> rhsAreaBalanceValues;
std::set<int> varToBeSetToZeroIfBelowThreshold; // place inside only ENS and Spillage variable
std::set<int> ensVariablesInsideAdqPatch; // place inside only ENS inside adq-patch

struct LinkVariable
{
LinkVariable() : directVar(-1), indirectVar(-1)
{
}
LinkVariable(int direct, int indirect) : directVar(direct), indirectVar(indirect)
{
}
inline bool check() const
{
if (directVar < 0)
Antares::logs.warning() << "directVar < 0 detected, this should not happen";
if (indirectVar < 0)
Antares::logs.warning() << "indirectVar < 0 detected, this should not happen";

return (directVar >= 0) && (indirectVar >= 0);
}
int directVar;
int indirectVar;
};

// links between two areas inside the adq-patch domain
std::map<int, LinkVariable> linkInsideAdqPatch;
std::map<int, double> rhsAreaBalanceValues_;
};
62 changes: 0 additions & 62 deletions src/solver/optimisation/adequacy_patch_csr/post_processing.cpp

This file was deleted.

29 changes: 0 additions & 29 deletions src/solver/optimisation/adequacy_patch_csr/post_processing.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

#include "../solver/optimisation/opt_structure_probleme_a_resoudre.h"
#include "../simulation/adequacy_patch_runtime_data.h"

#include "../solver/optimisation/opt_fonctions.h"
#include "hourly_csr_problem.h"
#include "sim_structure_probleme_economique.h"

namespace
Expand Down
Loading

0 comments on commit 5644fe4

Please sign in to comment.