-
Notifications
You must be signed in to change notification settings - Fork 25
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
Implement latest CSR comments #825
Merged
flomnes
merged 33 commits into
AntaresSimulatorTeam:feature/do-not-merge-csr-generate-executables
from
rte-i:feature/issue66-milos
Aug 24, 2022
Merged
Changes from 17 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
dd54bd4
Bump to CXX 17
flomnes 5a9254e
Clarify execution-info.ini file
flomnes 7d29b55
Merge pull request #65 from rte-i/feature/issue64-milos
Milos-RTEi c1054c2
Merge remote-tracking branch 'upstream/feature/csr-merge-develop' int…
Milos-RTEi 919fc6a
1. Make NumberOfVariables a reference var
Milos-RTEi 653af41
change function name CSR_DEBUG_
Milos-RTEi d593fb2
3. test Probleme.ExistenceDUneSolution directly
Milos-RTEi eda86bd
2. Slightly clearer version
Milos-RTEi 3525d44
4. make hoursRequiringCurtailmentSharing const var
Milos-RTEi 15e10dd
5. avoid cast sumENS[i] to int!
Milos-RTEi 65caf6e
17. move default thresholds to adequacy_patch.h
Milos-RTEi 6df6a4e
20. use A.size() in addArray function
Milos-RTEi 90c6f0b
19. create dedicated method solveCSR
Milos-RTEi 5352870
7. name change
Milos-RTEi 7086560
8. make methods of AdequacyPatchOptimization private
Milos-RTEi 5bdbd35
11. 14. 16 delete unused logs
Milos-RTEi cca06c7
9. delete forward declaration of HOURLY_CSR_PROBLEM
Milos-RTEi e513d85
Merge pull request #803 from AntaresSimulatorTeam/fix/execution-info-…
flomnes ab253ad
15. remove Double definition.
Milos-RTEi 363208c
12. 13 update copyright & Authors for adq-patch files
Milos-RTEi 97fb7e7
Merge pull request #779 from AntaresSimulatorTeam/feature/cxx-17
flomnes 3b4c181
Fix missing renewable columns in districts (sets of areas) (#802)
flomnes ac4f7f4
execution_info.ini : add OR-Tools used & solver (#820)
flomnes 5a9ee2f
Fix wrong number of cores + code de-duplication (#793)
flomnes 713f167
Release/8.3.1 (#818)
flomnes d6fbef8
Merge pull request #68 from rte-i/feature/issue66-milos
Milos-RTEi be94993
Merge pull request #67 from rte-i/feature/keep-track-with-rte-develop
Milos-RTEi 2ffb5b7
Merge remote-tracking branch 'origin/develop' into feature/adq-patch-4
Milos-RTEi b4ad703
make solveCSR private method
Milos-RTEi c865631
use auto instead of std::unique_ptr<PROBLEME_POINT_INTERIEUR>
Milos-RTEi 20d0bd3
float->double
Milos-RTEi 0164441
remove saveIntermediateResults
Milos-RTEi a5e6bd7
Merge pull request #70 from rte-i/feature/issue66-update
Milos-RTEi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/solver/optimisation/adequacy_patch_csr/construct_problem_constraints_LHS.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/solver/optimisation/adequacy_patch_csr/set_problem_cost_function.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/solver/optimisation/adequacy_patch_csr/set_variable_boundaries.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||||||||
/* | ||||||||||
** Copyright 2007-2018 RTE | ||||||||||
** Authors: Antares_Simulator Team | ||||||||||
** Copyright 2007-2022 RTE | ||||||||||
** Authors: RTE-international / Redstork / Antares_Simulator Team | ||||||||||
** | ||||||||||
** This file is part of Antares_Simulator. | ||||||||||
** | ||||||||||
|
@@ -55,9 +55,10 @@ extern "C" | |||||||||
|
||||||||||
using namespace Antares; | ||||||||||
|
||||||||||
void setInteriorPointProblem(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre, | ||||||||||
PROBLEME_POINT_INTERIEUR& Probleme) | ||||||||||
std::unique_ptr<PROBLEME_POINT_INTERIEUR> buildInteriorPointProblem( | ||||||||||
PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre) | ||||||||||
{ | ||||||||||
std::unique_ptr<PROBLEME_POINT_INTERIEUR> Probleme(new PROBLEME_POINT_INTERIEUR()); | ||||||||||
int ChoixToleranceParDefautSurLAdmissibilite; | ||||||||||
int ChoixToleranceParDefautSurLaStationnarite; | ||||||||||
int ChoixToleranceParDefautSurLaComplementarite; | ||||||||||
|
@@ -66,40 +67,42 @@ void setInteriorPointProblem(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre, | |||||||||
ChoixToleranceParDefautSurLaStationnarite = OUI_PI; | ||||||||||
ChoixToleranceParDefautSurLaComplementarite = OUI_PI; | ||||||||||
|
||||||||||
Probleme.NombreMaxDIterations = -1; | ||||||||||
Probleme.CoutQuadratique = ProblemeAResoudre->CoutQuadratique; | ||||||||||
Probleme.CoutLineaire = ProblemeAResoudre->CoutLineaire; | ||||||||||
Probleme.X = ProblemeAResoudre->X; | ||||||||||
Probleme.Xmin = ProblemeAResoudre->Xmin; | ||||||||||
Probleme.Xmax = ProblemeAResoudre->Xmax; | ||||||||||
Probleme.NombreDeVariables = ProblemeAResoudre->NombreDeVariables; | ||||||||||
Probleme.TypeDeVariable = ProblemeAResoudre->TypeDeVariable; | ||||||||||
|
||||||||||
Probleme.VariableBinaire = (char*)ProblemeAResoudre->CoutsReduits; | ||||||||||
|
||||||||||
Probleme.NombreDeContraintes = ProblemeAResoudre->NombreDeContraintes; | ||||||||||
Probleme.IndicesDebutDeLigne = ProblemeAResoudre->IndicesDebutDeLigne; | ||||||||||
Probleme.NombreDeTermesDesLignes = ProblemeAResoudre->NombreDeTermesDesLignes; | ||||||||||
Probleme.IndicesColonnes = ProblemeAResoudre->IndicesColonnes; | ||||||||||
Probleme.CoefficientsDeLaMatriceDesContraintes | ||||||||||
Probleme->NombreMaxDIterations = -1; | ||||||||||
Probleme->CoutQuadratique = ProblemeAResoudre->CoutQuadratique; | ||||||||||
Probleme->CoutLineaire = ProblemeAResoudre->CoutLineaire; | ||||||||||
Probleme->X = ProblemeAResoudre->X; | ||||||||||
Probleme->Xmin = ProblemeAResoudre->Xmin; | ||||||||||
Probleme->Xmax = ProblemeAResoudre->Xmax; | ||||||||||
Probleme->NombreDeVariables = ProblemeAResoudre->NombreDeVariables; | ||||||||||
Probleme->TypeDeVariable = ProblemeAResoudre->TypeDeVariable; | ||||||||||
|
||||||||||
Probleme->VariableBinaire = (char*)ProblemeAResoudre->CoutsReduits; | ||||||||||
|
||||||||||
Probleme->NombreDeContraintes = ProblemeAResoudre->NombreDeContraintes; | ||||||||||
Probleme->IndicesDebutDeLigne = ProblemeAResoudre->IndicesDebutDeLigne; | ||||||||||
Probleme->NombreDeTermesDesLignes = ProblemeAResoudre->NombreDeTermesDesLignes; | ||||||||||
Probleme->IndicesColonnes = ProblemeAResoudre->IndicesColonnes; | ||||||||||
Probleme->CoefficientsDeLaMatriceDesContraintes | ||||||||||
= ProblemeAResoudre->CoefficientsDeLaMatriceDesContraintes; | ||||||||||
Probleme.Sens = ProblemeAResoudre->Sens; | ||||||||||
Probleme.SecondMembre = ProblemeAResoudre->SecondMembre; | ||||||||||
Probleme->Sens = ProblemeAResoudre->Sens; | ||||||||||
Probleme->SecondMembre = ProblemeAResoudre->SecondMembre; | ||||||||||
|
||||||||||
Probleme.AffichageDesTraces = NON_PI; | ||||||||||
Probleme->AffichageDesTraces = NON_PI; | ||||||||||
|
||||||||||
Probleme.UtiliserLaToleranceDAdmissibiliteParDefaut = ChoixToleranceParDefautSurLAdmissibilite; | ||||||||||
Probleme->UtiliserLaToleranceDAdmissibiliteParDefaut = ChoixToleranceParDefautSurLAdmissibilite; | ||||||||||
|
||||||||||
Probleme.UtiliserLaToleranceDeStationnariteParDefaut | ||||||||||
Probleme->UtiliserLaToleranceDeStationnariteParDefaut | ||||||||||
= ChoixToleranceParDefautSurLaStationnarite; | ||||||||||
|
||||||||||
Probleme.UtiliserLaToleranceDeComplementariteParDefaut | ||||||||||
Probleme->UtiliserLaToleranceDeComplementariteParDefaut | ||||||||||
= ChoixToleranceParDefautSurLaComplementarite; | ||||||||||
|
||||||||||
Probleme.CoutsMarginauxDesContraintes = ProblemeAResoudre->CoutsMarginauxDesContraintes; | ||||||||||
Probleme->CoutsMarginauxDesContraintes = ProblemeAResoudre->CoutsMarginauxDesContraintes; | ||||||||||
|
||||||||||
Probleme.CoutsMarginauxDesContraintesDeBorneInf = ProblemeAResoudre->CoutsReduits; | ||||||||||
Probleme.CoutsMarginauxDesContraintesDeBorneSup = ProblemeAResoudre->CoutsReduits; | ||||||||||
Probleme->CoutsMarginauxDesContraintesDeBorneInf = ProblemeAResoudre->CoutsReduits; | ||||||||||
Probleme->CoutsMarginauxDesContraintesDeBorneSup = ProblemeAResoudre->CoutsReduits; | ||||||||||
|
||||||||||
return Probleme; | ||||||||||
} | ||||||||||
|
||||||||||
void setToZeroIfBelowThreshold(double* pt, int Var, HOURLY_CSR_PROBLEM& hourlyCsrProblem) | ||||||||||
|
@@ -128,7 +131,7 @@ void storeInteriorPointResults(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre, | |||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
void CSR_DEBUG_BLAH(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre) | ||||||||||
void CSR_DEBUG_HANDLE(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre) | ||||||||||
{ | ||||||||||
int Var; | ||||||||||
|
||||||||||
|
@@ -177,7 +180,7 @@ void handleInteriorPointError(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre, | |||||||||
<< ". hour: " << weekNb * hoursInWeek + hourlyCsrProblem.hourInWeekTriggeredCsr + 1; | ||||||||||
|
||||||||||
#ifndef NDEBUG | ||||||||||
CSR_DEBUG_BLAH(ProblemeAResoudre); | ||||||||||
CSR_DEBUG_HANDLE(ProblemeAResoudre); | ||||||||||
#endif | ||||||||||
} | ||||||||||
|
||||||||||
|
@@ -186,11 +189,10 @@ bool ADQ_PATCH_CSR(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre, | |||||||||
uint weekNb, | ||||||||||
int yearNb) | ||||||||||
{ | ||||||||||
PROBLEME_POINT_INTERIEUR Probleme; | ||||||||||
setInteriorPointProblem(ProblemeAResoudre, Probleme); | ||||||||||
PI_Quamin(&Probleme); // resolution | ||||||||||
ProblemeAResoudre->ExistenceDUneSolution = Probleme.ExistenceDUneSolution; | ||||||||||
if (ProblemeAResoudre->ExistenceDUneSolution == OUI_PI) | ||||||||||
std::unique_ptr<PROBLEME_POINT_INTERIEUR> Probleme | ||||||||||
= buildInteriorPointProblem(ProblemeAResoudre); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
PI_Quamin(Probleme.get()); // resolution | ||||||||||
if (Probleme->ExistenceDUneSolution == OUI_PI) | ||||||||||
{ | ||||||||||
storeInteriorPointResults(ProblemeAResoudre, hourlyCsrProblem); | ||||||||||
return true; | ||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to merge branch
develop
for that, since it contains #779. This feature is only available from C++17.