Skip to content

Commit

Permalink
Feature/adq patch final (#1062)
Browse files Browse the repository at this point in the history
* 7. re-pack CSR run into weeklyOptProblem->solve method

* adopt RTE syntax for switch/case

* remove comments

* change RC number

* change beta release number

* unit test for CSR-calculateAreaFlowBalance

* small refacto

* unit test bug fix

* 4. remove unused

* 6.1 MemAllocMemset

* 5. remove return

* 3. remove debug log

* 2. move to csr

* 1. refacto

* 6.2 hide column

* 6.2

* 3. move log

* 3. move log..

* clean

* small fix year count

* hot start

* relax var bounds

* remove ENS <= densNew constraint, set as var bound

* remove set values to NaN if csr solver fails

* relax bining constrains for csr solver

* make csr crash log more expressive

* clean some logs

* beta 3 -> beta 4

* wrong relaxation of bc - bug fix

* logg out triggered csr hours

* refacto 1e-3

* logg out csr warnings - refacto

* update antares output dens value

* more expressive log

* update dens and use it as pto

* dont include linear cost coeff - temporary beta6 only

* beta5->beta6

* 10. bring back type of var to origin quad solver - mistake

* 2. remove default values for the solver accuracy

* change function  name to ADQ_PATCH_CSR

* 6. remove comments

* 7. remove nused transport cost

* 9. remove comments

* 11. refacto - int NumberOfVariables

* 8. remove NomDeLaContrainte

* bring back linear hurdle costs

* set to zero ENS & spillage if below threshold (avoid LOLP=100% dummy values)

* small refacto

* 4. make subfunction CSR_DEBUG_BLAH

* 1. move csr problem functions to separate directory

* 12. Add "Include hurdle cost" false/true button

* refacto avoid bugs

* refacto avoid bugs

* refacto bugs

* Fix build

Rename LinkCapacityForAdequacyPatchFirstStep -> ntcSetToZeroStatus_AdqPatchStep1

* 1. Make NumberOfVariables a reference var

* change function name CSR_DEBUG_

* 3. test Probleme.ExistenceDUneSolution directly

* 2. Slightly clearer version

* 4. make hoursRequiringCurtailmentSharing const var

* 5. avoid cast sumENS[i] to int!

* 17. move default thresholds to adequacy_patch.h

* 20. use A.size() in addArray function

* 19. create dedicated method solveCSR

* 7. name change

* 8. make methods of AdequacyPatchOptimization private

* 11. 14. 16 delete unused logs

* 9.  delete forward declaration of HOURLY_CSR_PROBLEM

* 15. remove Double definition.

* 12. 13 update copyright & Authors for adq-patch files

* make solveCSR private method

* use auto instead of std::unique_ptr<PROBLEME_POINT_INTERIEUR>

* float->double

* remove saveIntermediateResults

* code smells parameters.cpp

* critical-CodeSmell-adequacy_patch.cpp

* critical-codeSmells- set_problem_cost.cpp

* info-CodeSmell - remove todo-s

* CodeSmells - global var should be const

* NULL->nullptr

* use default destructor

* protected->private in adq-patch-area-grid.h

* use default constructor in adequacy-patch-areas

* Add the "explicit" keyword to AdequacyPatchAreas constructor

* NULL->nullptr in adequacy-patch-options.cpp

* = default, AdequacyPatchOptions

* Add the "explicit" keyword to AdequacyPatchOptions constructor

* Remove these useless parentheses

* Remove these useless parentheses

* Remove the unused parameter "weekNb",

* Move these 4 #include directives to the top of the file

* declaration shadows a local variable

* Value stored to 'ProblemeAResoudre' is never read

* function should be declared "const"

* Use "std::make_unique" to construct "std::unique_ptr

* Value stored to 'out' during its initialization is never read

* major-CodeSmells-adequacy-patch-options.cpp

* remove "never read" variables

* const& buttonType in updateButton

* Replace this "enum" with "enum class"  AdqPatchPTO

* double*->const double* in addArray

* MinorCodeSmell-s construct_LHS

* MinorCodeSmell-s construct_RHS

* MinorCodeSmell-s construct_variables

* MinorCodeSmell-s cost_function

* MinorCodeSmell-s set_var_bounds

* MinorCodeSmell-s solve_problem

* MinorCodeSmell-s economy.cpp

* Remove redundant public  access specifier

* Remove this redundant access specifier

* MinorCodeSmell-s adq-patch-unit-tests

* Concatenate  namespace with the nested ones.

* Use "override" or "final" instead of "virtual".

* Remove public redundant access specifier;

* MinorCodeSmell-s adequacy-patch-areas.h

* Concatenate namespace with the nested ones.

* Make the type of auto& study ; a reference-to-const

* MinorCodeSmell-s AdequacyPatchOptions

* "not"-> "!" , "and"-> "&&"

* Add adequacy-patch CSR study format changes (#817)

* beta 7

* create GUI for csr var relax button

* connect GUI to logic

* threshold e-3 >e-5

* fix (GUI wont pass smaller than 10^-6)

* Value stored to 'PaliersThermiquesDuPays' is never read

* "std::string" -> "std::string_view"

* make getHoursRequiringCurtailmentSharing const method

* remove unused var

* assign ProblemeAResoudre properly

* Reporting of DENS_new in GUI result for all hours

* Check CSR cost-fun-value prior&after CSR-opt - GUI

* refacto due to pre-calculating dens_new for all hours prior to csr optim

* add "SpilledenergyAfterCSR" column

* TODO: densNewValues

* Correction of MRG.PRICE Price Cap in hours LOLE>0.5 after CSR

* refacto "DENS_new" parameter calc, same thing at the end!?

* add DTG. MRG INT/FIN columns to GUI

* copy-paste spilled Energy values into spilled Energy values after CSR prior to CSR

* Check CSR cost value prior to and after - UNTESTED

* refacto on DTG MRG CSR columns GUI

* change log to info in "Check CSR cost value"

* test implementation csr fun cost prior/after

* refacto LMR violations according to the agreement with Daniel + clean

* csr-postProcess - adjust ENS value and calc dtgMrgCsr

* small refacto

* refacto - adjust mrgPrice after caclulating dtgMrgCsr and new Ens

* log update

* refacto setToZeroIfBelowThreshold

* update/refacto log csr-solver

* refacto logs @ solve_problem.cpp

* typo

* beta7 -> beta8

* add prefix [adq-patch] to info logs

* move adqPatchPostProcess after HydroRemix

* refactor + change -  storeOrDisregardInteriorPointResults

* beta 9.1

* refactor solveCSR

* add "- dtgMrg" to densNew formula

* beta 10

* fix error

* update 13-file-format.md for adq-patch CSR

* update 14-adequacy-patch.md for adq-patch CSR

* change CSR objective function (Elia)

* change CSR objective function (Elia) - doc update

* beta11

* change CSR objective function (Elia) - doc update

* 14-adq-patch-doc-bug fix (unrecognized characters)

* 14-adq-patch-doc-bug fix (unrecognized characters)-2

* Fix build (linking KO b/c of missing functions)

* Fix build

* Apply clang-format

* [UI] Fix build

* Fix code smells reported as bugs

* Use BOOST_CHECK_EQUAL to check equality (#1056)

To display a more expressive error message in case of failure, for example

src/tests/src/solver/optimisation/adequacy_patch.cpp(481): error: in "calculateAreaFlowBalanceForOneTimeStep_outside_inside_IncludeOut_negativeFlow_initEnsEqualTo0": check densNew == 0.1 has failed [0 != 0.10000000000000001]

* Adequacy patch refactoring (#962)

* [FIX] Refactored var names

* [REFAC] Changed class and var names in economy.h/cpp

* [REFAC] More correction of PR 903

* Fix build after rebase

Co-authored-by: Florian OMNES <[email protected]>

* Refactor adq patch (part 2) (#964)

* [FIX] Refactored var names

* [REFAC] Changed class and var names in economy.h/cpp

* [REFAC] More correction of PR 903

* Fix build after rebase

* Refactor adq patch (by gp) : lowering the solvers dependence to "state"

* Refactor adq patch (by gp) : lowering the solvers dependence to "state" (part 2)

* Refactor adq patch (by gp) : remove solveCSR from classic optimization problem

* Restore function setBoundsAdqPatch

* Fix build

Co-authored-by: Vincent Payet <[email protected]>
Co-authored-by: Florian OMNES <[email protected]>

* Adequacy patch : refactor economy (weekly optimization) (#968)

* [FIX] Refactored var names

* [REFAC] Changed class and var names in economy.h/cpp

* [REFAC] More correction of PR 903

* Fix build after rebase

* Refactor adq patch (by gp) : lowering the solvers dependence to "state"

* Refactor adq patch (by gp) : lowering the solvers dependence to "state" (part 2)

* Refactor adq patch (by gp) : remove solveCSR from classic optimization problem

* Refactor adq patch (by gp) : correction after merge (to get compilation done)

* adq patch - refactor economy : renaming

* adq patch - refactor economy : define a weekyOptimization for each problemeHebdo

* solveCSR => implementation in separate file

* adq patch - refactor economy : correction to avoid conflict in the next merge

* adq patch - refactor economy : move declaration of class interfaceWeeklyOptimization in a new file

* adq patch - refactor economy : extract weekly optimization classes in separate source files

* adq patch - refactor economy : correction due to review

* adq patch - refactor economy : remove useless function arguments due to sonar review

* Fix build

* Restore function setBoundsAdqPatch

* Add virtual dtors

* Remove useless return statement

* Nested namespaces, formatting

* Make protected members const

Co-authored-by: Vincent Payet <[email protected]>
Co-authored-by: Florian OMNES <[email protected]>

* Adequacy patch :  refactor curtailment sharing (#971)

* Adequacy patch CSR - final (#958)

* change origin/extremityAreaType to AreaMode

* refacto function SetNTCForAdequacyFirstStep

* LinkCapacityForAdqPatchFirstStepFromAreaOutsideToAreaInsideAdq name change

* name change for LinkCapacityForAdequacyPatchFirstStep

* remove returnNTC form adq functions.

* remove unnecessary break

* make readAdqPatchMode function

* make ini file more expressive

* remove additional check for ini file

* refacto

* make version 8.3.0

* Revert "make version 8.3.0"

* fix

* fix

* synchronize names setToZeroNTCfrom..

* synchronize names pBtn...

* synchronize adequacy-patch-options.cpp

* synchronize names adqm..

* synchronize names AreaType to AreaMode

* synchronize names LinkCapacity..

* synchronize name physicalAreaInsideAdqPatch

* 1. do not modify Yuni library

* 3. AdequacyPatchPTO name change

* 3. update

* 2-8. replace seeds with two thresholds

* 9. resetAdqPatchParameters

* 10. re-name lmrViolations.h

* 25-26. re-name AdequacyPatchConfigure to AdequacyPatchOptions

* 27. cellValue change

* 28. is already implemented + small refacto

* small refacto

* 29. updateButton function

* 13. renaming

* 14. refactoring

* 15. remove redundancy

* 16. refactoring

* 20. separate LHS to functions

* 20. separate RHS to functions

* clean

* 23. separate Costs into functions

* 22. separate Bounds into functions

* 21. separate Construction of variables into functions

* 19. separate quad-solver into sub-functions

* 11. separate getHoursRequiringCurtailmentSharing into two sub-functions

* 17+18+24. make OPT_ functions private methods and make public run method

* clean

* clean

* clean

* 0 as a default value, and (value > threshold)

* 4. add else if for AdqPatchPTO::isDens

* bring back some debugg logs for easy result check

* 2. make calculateCsrParameters method of HOURLY_CSR_PROBLEM

* clean

* 1. use std::vector for sumENS

* 9. repack CSR ui input data in parameters.h

* 8. placing all functions inside adequacy_patch.h to namespace Adequcy patch

* 7. re-pack CSR run into weeklyOptProblem->solve method

* adopt RTE syntax for switch/case

* remove comments

* change RC number

* change beta release number

* unit test for CSR-calculateAreaFlowBalance

* small refacto

* unit test bug fix

* 4. remove unused

* 6.1 MemAllocMemset

* 5. remove return

* 3. remove debug log

* 2. move to csr

* 1. refacto

* 6.2 hide column

* 6.2

* 3. move log

* 3. move log..

* clean

* small fix year count

* hot start

* relax var bounds

* remove ENS <= densNew constraint, set as var bound

* remove set values to NaN if csr solver fails

* relax bining constrains for csr solver

* make csr crash log more expressive

* clean some logs

* beta 3 -> beta 4

* wrong relaxation of bc - bug fix

* logg out triggered csr hours

* refacto 1e-3

* logg out csr warnings - refacto

* update antares output dens value

* more expressive log

* update dens and use it as pto

* dont include linear cost coeff - temporary beta6 only

* beta5->beta6

* 10. bring back type of var to origin quad solver - mistake

* 2. remove default values for the solver accuracy

* change function  name to ADQ_PATCH_CSR

* 6. remove comments

* 7. remove nused transport cost

* 9. remove comments

* 11. refacto - int NumberOfVariables

* 8. remove NomDeLaContrainte

* bring back linear hurdle costs

* set to zero ENS & spillage if below threshold (avoid LOLP=100% dummy values)

* small refacto

* 4. make subfunction CSR_DEBUG_BLAH

* 1. move csr problem functions to separate directory

* 12. Add "Include hurdle cost" false/true button

* refacto avoid bugs

* refacto avoid bugs

* refacto bugs

* Fix build

Rename LinkCapacityForAdequacyPatchFirstStep -> ntcSetToZeroStatus_AdqPatchStep1

* 1. Make NumberOfVariables a reference var

* change function name CSR_DEBUG_

* 3. test Probleme.ExistenceDUneSolution directly

* 2. Slightly clearer version

* 4. make hoursRequiringCurtailmentSharing const var

* 5. avoid cast sumENS[i] to int!

* 17. move default thresholds to adequacy_patch.h

* 20. use A.size() in addArray function

* 19. create dedicated method solveCSR

* 7. name change

* 8. make methods of AdequacyPatchOptimization private

* 11. 14. 16 delete unused logs

* 9.  delete forward declaration of HOURLY_CSR_PROBLEM

* 15. remove Double definition.

* 12. 13 update copyright & Authors for adq-patch files

* make solveCSR private method

* use auto instead of std::unique_ptr<PROBLEME_POINT_INTERIEUR>

* float->double

* remove saveIntermediateResults

* code smells parameters.cpp

* critical-CodeSmell-adequacy_patch.cpp

* critical-codeSmells- set_problem_cost.cpp

* info-CodeSmell - remove todo-s

* CodeSmells - global var should be const

* NULL->nullptr

* use default destructor

* protected->private in adq-patch-area-grid.h

* use default constructor in adequacy-patch-areas

* Add the "explicit" keyword to AdequacyPatchAreas constructor

* NULL->nullptr in adequacy-patch-options.cpp

* = default, AdequacyPatchOptions

* Add the "explicit" keyword to AdequacyPatchOptions constructor

* Remove these useless parentheses

* Remove these useless parentheses

* Remove the unused parameter "weekNb",

* Move these 4 #include directives to the top of the file

* declaration shadows a local variable

* Value stored to 'ProblemeAResoudre' is never read

* function should be declared "const"

* Use "std::make_unique" to construct "std::unique_ptr

* Value stored to 'out' during its initialization is never read

* major-CodeSmells-adequacy-patch-options.cpp

* remove "never read" variables

* const& buttonType in updateButton

* Replace this "enum" with "enum class"  AdqPatchPTO

* double*->const double* in addArray

* MinorCodeSmell-s construct_LHS

* MinorCodeSmell-s construct_RHS

* MinorCodeSmell-s construct_variables

* MinorCodeSmell-s cost_function

* MinorCodeSmell-s set_var_bounds

* MinorCodeSmell-s solve_problem

* MinorCodeSmell-s economy.cpp

* Remove redundant public  access specifier

* Remove this redundant access specifier

* MinorCodeSmell-s adq-patch-unit-tests

* Concatenate  namespace with the nested ones.

* Use "override" or "final" instead of "virtual".

* Remove public redundant access specifier;

* MinorCodeSmell-s adequacy-patch-areas.h

* Concatenate namespace with the nested ones.

* Make the type of auto& study ; a reference-to-const

* MinorCodeSmell-s AdequacyPatchOptions

* "not"-> "!" , "and"-> "&&"

* beta 7

* create GUI for csr var relax button

* connect GUI to logic

* threshold e-3 >e-5

* fix (GUI wont pass smaller than 10^-6)

* Value stored to 'PaliersThermiquesDuPays' is never read

* "std::string" -> "std::string_view"

* make getHoursRequiringCurtailmentSharing const method

* remove unused var

* assign ProblemeAResoudre properly

* Reporting of DENS_new in GUI result for all hours

* Check CSR cost-fun-value prior&after CSR-opt - GUI

* refacto due to pre-calculating dens_new for all hours prior to csr optim

* add "SpilledenergyAfterCSR" column

* TODO: densNewValues

* Correction of MRG.PRICE Price Cap in hours LOLE>0.5 after CSR

* refacto "DENS_new" parameter calc, same thing at the end!?

* add DTG. MRG INT/FIN columns to GUI

* copy-paste spilled Energy values into spilled Energy values after CSR prior to CSR

* Check CSR cost value prior to and after - UNTESTED

* refacto on DTG MRG CSR columns GUI

* change log to info in "Check CSR cost value"

* test implementation csr fun cost prior/after

* refacto LMR violations according to the agreement with Daniel + clean

* csr-postProcess - adjust ENS value and calc dtgMrgCsr

* small refacto

* refacto - adjust mrgPrice after caclulating dtgMrgCsr and new Ens

* log update

* refacto setToZeroIfBelowThreshold

* update/refacto log csr-solver

* refacto logs @ solve_problem.cpp

* typo

* beta7 -> beta8

* add prefix [adq-patch] to info logs

* move adqPatchPostProcess after HydroRemix

* refactor + change -  storeOrDisregardInteriorPointResults

* beta 9.1

* refactor solveCSR

* add "- dtgMrg" to densNew formula

* beta 10

Co-authored-by: hugo-antoine-rtei <[email protected]>
Co-authored-by: rtei-pw <[email protected]>
Co-authored-by: rtei-pw <[email protected]>
Co-authored-by: Florian OMNES <[email protected]>
Co-authored-by: Hugo ANTOINE (RTEi) <[email protected]>

* [FIX] FIx compile error

* [FIX] Refactored var names

* [REFAC] Changed class and var names in economy.h/cpp

* [REFAC] More correction of PR 903

* Refactor adq patch (by gp) : lowering the solvers dependence to "state"

* Refactor adq patch (by gp) : lowering the solvers dependence to "state" (part 2)

* Refactor adq patch (by gp) : correction after merge (to get compilation done)

* adq patch - refactor economy : renaming

* Refactor adq patch (by gp) : remove solveCSR from classic optimization problem

* adq patch - refactor economy : define a weekyOptimization for each problemeHebdo

* adq patch - refactor economy : correction to avoid conflict in the next merge

* adq patch - refactor economy : move declaration of class interfaceWeeklyOptimization in a new file

* adq patch - refactor economy : extract weekly optimization classes in separate source files

* adq patch - refactor economy : correction due to review

* adq patch - refactor economy : remove useless function arguments due to sonar review

* adq patch - refactor csr : simplify and remove useless things

* adq patch - refactor csr : split adequacy_patch.h/.cpp into local matching and curtailment sharing sources files

* Clean up headers

Co-authored-by: Milos <[email protected]>
Co-authored-by: hugo-antoine-rtei <[email protected]>
Co-authored-by: rtei-pw <[email protected]>
Co-authored-by: rtei-pw <[email protected]>
Co-authored-by: Florian OMNES <[email protected]>
Co-authored-by: Hugo ANTOINE (RTEi) <[email protected]>
Co-authored-by: Vincent Payet <[email protected]>

* Adequacy patch vincent final (#1087)

* [FIX] Namespace concatenation in src/solver/simulation/

* [DEV] Moved reset csr and lm in dedicated structs

* [DEV] Create class CsrQuadraticProblem and moved functions in

* [DEV] Refactored functions in CsrQuadraticProblem class

* [DEV] FIx reference

* Pass hourlyCsrProblem.hourInWeekTriggeredCsr, not hourlyCsrProblem

* Nested namespaces

* Fix build, use non-const ref in class `CsrQuadraticProblem`

* [DEV] Concatenate namespace before merge

Co-authored-by: Florian OMNES <[email protected]>

* Remove state from interpolateWaterValue

* [DEV] Concatenate namespace done (#1094)

* Check for incompatible hurdle cost options (#1096)

* [DEV] Add rte banner in files missing it (#1097)

* [FIX] Adequacy code smells (#1100)

* [FIX] First batch of code smell

* [FIX] More smell fixes

* [FIX] Fix nested if and fort

* [FIX] Remove using Antares::Data::AdequacyPatch and solved compiles errors related

* [FIX] More code smells

* [FIX] Compile errors

* [FIX] Clarify condition

* [CSR] Clarify implicit var convention (#1095)

* CSR : clarify implicit convention on variable numbers for links

* CSR: clarify debug logs

* Renaming after PR remarks

* Pass hour instead of hourlyCsrProblem (#1098)

* Pass hour instead of hourlyCsrProblem

* Pass int for hour instead of a struct containing it

* move calculation of LMR violations from CSR source file to adq patch weekly problem (#1102)

* Move var declaration to right scope (#1103)

* [FIX] Move var declaration to right scope

* Fix infinite loop, possible other bug (#1107)

* Preparatory refactor to use own instance of PROBLEME_A_RESOUDRE (#1099)

* Simplify UtiliserLaToleranceDAdmissibiliteParDefaut, etc.

* Use PROBLEME_POINT_INTERIEUR for calculateCsrCostFunctionValue

* Pass hour instead of HOURLY_CSR_PROBLEM&

* Use PROBLEME_POINT_INTERIEUR for CSR_DEBUG_HANDLE, handleInteriorPointError

* PR remarks (use ref on object, not unique_ptr)

* Rename HOURLY_CSR_PROBLEM -> HourlyCSRProblem

* Apply clang-format

* Move files

* Move csr_quadratic_problem.h,cpp

* Remove unused fwd declaration

* Don't instantiate HourlyCSRProblem for every hour, setHour instead

* Rename OPT_ConstruireLaMatriceDesContraintesDuProblemeQuadratique_CSR

* Use std::vector::data instead of malloc/free

* Some renaming

* Add forgotten '{'

* Use our own instance of `PROBLEME_ANTARES_A_RESOUDRE` (#1105)

* Simplify UtiliserLaToleranceDAdmissibiliteParDefaut, etc.

* Use PROBLEME_POINT_INTERIEUR for calculateCsrCostFunctionValue

* Pass hour instead of HOURLY_CSR_PROBLEM&

* Use PROBLEME_POINT_INTERIEUR for CSR_DEBUG_HANDLE, handleInteriorPointError

* PR remarks (use ref on object, not unique_ptr)

* Rename HOURLY_CSR_PROBLEM -> HourlyCSRProblem

* Apply clang-format

* Move files

* Move csr_quadratic_problem.h,cpp

* Remove unused fwd declaration

* Don't instantiate HourlyCSRProblem for every hour, setHour instead

* Rename OPT_ConstruireLaMatriceDesContraintesDuProblemeQuadratique_CSR

* Use std::vector::data instead of malloc/free

* Some renaming

* Use our own instance of PROBLEME_ANTARES_A_RESOUDRE

* Refactor 2 more functions

OPT_InitialiserLeSecondMembreDuProblemeQuadratique_CSR
OPT_ConstruireLaListeDesVariablesOptimiseesDuProblemeQuadratique_CSR

* Use reference instead of raw pointer

* Extract allocation function for PROBLEME_ANTARES_A_RESOUDRE

* Use std::fill_n instead of memset

* PR remark

* Extract OPT_FreeOptimizationData

* Handle memory allocation/deallocation

* UpperCamelCase for some classes, move sources to adequacy_patch_csr (#1108)

* [FIX] UpperCamelCase for some classes

* [FIX] Moved csr files in adequacy_patch_csr/

* [FIX] Swap DefaultWeeklyOptimization WeeklyOptimization names

* [FIX] Add Antares::Data::Optimization namespace

* Remove `OPT_*_CSR` functions (#1111)

* Remove OPT_*_CSR functions

* Rename hourInWeekTriggeredCsr -> triggeredHour

* Fix regression related to while loop and unitialized quadratic costs (#1112)

* Fix regression related to while loop

* Fix 2nd regression related to unitialized quadratic cost

* Fix build after merge

* Fix a few more code smells (#1113)

* Fix a few code smells

* Apply clang-format

* Remove unused function ResetButtonSpecify

* Code smells  (#1114)

* [FIX] Code smells

* Temporarily disable all release tests

* Use simtest v8.5.0b

* Refactor optimization post process (#1109)

* move calculation of LMR violations from CSR source file to adq patch weekly problem

* Refactor Optimization post processes : first work : add abstractions for post-process commands and for a list of them.

* Refactor Optimization post processes : move the first post process in the list of post processes to be run

* Refactor Optimization post processes : fixing a regression

* Refactor Optimization post processes : moving the code of the post process associated to dispatchable margin into the command class

* Refactor Optimization post processes : some cleaning (see details in the commit's body)

- Narrow arguments of optimization post process functions. For example, study is passes while we only need the study's collection of areas
- Not pass the constant "nbHoursInAWeek" as an argument, rather make it a constant visible by every function using it.
- Remove some useless headers

* Refactor Optimization post processes : fixing a crash

* Refactor Optimization post processes : adding hydro levels update to list of post process

* Refactor Optimization post processes : adding hydro remix to the list of post process

* Refactor Optimization post processes : adding DTG margin for adq patch to the list of post process

* Refactor Optimization post processes : forgot to remove adqPatchPostProcess function from curtailment sharing problem

* Refactor Optimization post processes : adding hydro levels update (after remix) to list of post process

* Refactor Optimization post processes : adding post process "interpolate water value" to list of post process

* Refactor Optimization post processes : adding post process "Hydro Levels Final Update" to list of post process

* [skip ci] Refactor Optimization post processes : adding an empty CSR command to list of post process (to be filled later)

* Refactor Optimization post processes : correction after code review

* [skip ci] Refactor Optimization post processes : make destructors virtual

* [FIX] Changed ProblemeHebdo to problemeHebdo (#1124)

* Fix linking issue in libmodel

* Move CSR from adq patch to post process cmd (#1118)

* move calculation of LMR violations from CSR source file to adq patch weekly problem

* Refactor Optimization post processes : first work : add abstractions for post-process commands and for a list of them.

* Refactor Optimization post processes : move the first post process in the list of post processes to be run

* Refactor Optimization post processes : fixing a regression

* Refactor Optimization post processes : moving the code of the post process associated to dispatchable margin into the command class

* Refactor Optimization post processes : some cleaning (see details in the commit's body)

- Narrow arguments of optimization post process functions. For example, study is passes while we only need the study's collection of areas
- Not pass the constant "nbHoursInAWeek" as an argument, rather make it a constant visible by every function using it.
- Remove some useless headers

* Refactor Optimization post processes : fixing a crash

* Refactor Optimization post processes : adding hydro levels update to list of post process

* Refactor Optimization post processes : adding hydro remix to the list of post process

* Refactor Optimization post processes : adding DTG margin for adq patch to the list of post process

* Refactor Optimization post processes : forgot to remove adqPatchPostProcess function from curtailment sharing problem

* Refactor Optimization post processes : adding hydro levels update (after remix) to list of post process

* Refactor Optimization post processes : adding post process "interpolate water value" to list of post process

* Refactor Optimization post processes : adding post process "Hydro Levels Final Update" to list of post process

* [skip ci] Refactor Optimization post processes : adding an empty CSR command to list of post process (to be filled later)

* Refactor Optimization post processes : correction after code review

* [skip ci] Refactor Optimization post processes : make destructors virtual

* Moving curtailment sharing from adequacy patch to a post process command

* [skip ci] Moving CSR to a post process command : cleaning

* Remove `struct`, clean up

* Apply clang-format

Co-authored-by: Florian OMNES <[email protected]>

* [FIX] Add local_matching subdir (#1125)

* Change Var to var (#1126)

* [FIX] Change Var to var in optimisation folder

* [FIX] Refactored old code

* Fix/move csr to post process cmd (#1128)

* move calculation of LMR violations from CSR source file to adq patch weekly problem

* Refactor Optimization post processes : first work : add abstractions for post-process commands and for a list of them.

* Refactor Optimization post processes : move the first post process in the list of post processes to be run

* Refactor Optimization post processes : fixing a regression

* Refactor Optimization post processes : moving the code of the post process associated to dispatchable margin into the command class

* Refactor Optimization post processes : some cleaning (see details in the commit's body)

- Narrow arguments of optimization post process functions. For example, study is passes while we only need the study's collection of areas
- Not pass the constant "nbHoursInAWeek" as an argument, rather make it a constant visible by every function using it.
- Remove some useless headers

* Refactor Optimization post processes : fixing a crash

* Refactor Optimization post processes : adding hydro levels update to list of post process

* Refactor Optimization post processes : adding hydro remix to the list of post process

* Refactor Optimization post processes : adding DTG margin for adq patch to the list of post process

* Refactor Optimization post processes : forgot to remove adqPatchPostProcess function from curtailment sharing problem

* Refactor Optimization post processes : adding hydro levels update (after remix) to list of post process

* Refactor Optimization post processes : adding post process "interpolate water value" to list of post process

* Refactor Optimization post processes : adding post process "Hydro Levels Final Update" to list of post process

* [skip ci] Refactor Optimization post processes : adding an empty CSR command to list of post process (to be filled later)

* Refactor Optimization post processes : correction after code review

* [skip ci] Refactor Optimization post processes : make destructors virtual

* Moving curtailment sharing from adequacy patch to a post process command

* [skip ci] Moving CSR to a post process command : cleaning

* Remove `struct`, clean up

* Apply clang-format

* Remove `struct`, clean up

---------

Co-authored-by: Guillaume PIERRE <[email protected]>

* Restore tests for releases

* Add adequacy-patch-CSR

* Re-order format change documentation

---------

Co-authored-by: Milos A <[email protected]>
Co-authored-by: Milos <[email protected]>
Co-authored-by: rtei-pw <[email protected]>
Co-authored-by: Hugo ANTOINE (RTEi) <[email protected]>
Co-authored-by: hugo-antoine-rtei <[email protected]>
Co-authored-by: payetvin <[email protected]>
Co-authored-by: guilpier-code <[email protected]>
Co-authored-by: Vincent Payet <[email protected]>
Co-authored-by: rtei-pw <[email protected]>
Co-authored-by: Jason Marechal <[email protected]>
Co-authored-by: Guillaume PIERRE <[email protected]>
  • Loading branch information
12 people authored Jan 30, 2023
1 parent f458c7c commit 1fe63ce
Show file tree
Hide file tree
Showing 136 changed files with 7,372 additions and 2,173 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ jobs:
path: 'simtest.json'
prop_path: 'version'

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

- name: Run tests about infinity on BCs RHS
if: ${{ env.IS_PUSH == 'true' }}
uses: ./.github/workflows/run-tests
Expand All @@ -154,7 +162,7 @@ jobs:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: short-tests
os: ${{ matrix.test-platform }}

- name: Run mps tests
if: ${{ env.IS_PUSH == 'true' }}
uses: ./.github/workflows/run-tests
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ jobs:
path: 'simtest.json'
prop_path: 'version'

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

- name: Run medium-tests
uses: ./.github/workflows/run-tests
with:
Expand Down
46 changes: 29 additions & 17 deletions docs/reference-guide/03-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Antares GUI gives access to a general menu of commands whose name and meanin

- **New** Create a new empty study to be defined entirely from scratch (network topology, interconnections
ratings, thermal power plants list, fuel costs, hydro inflows stats, wind speed stats, load profiles ,etc.)

- **Open** Load in memory data located in a specified Antares study folder. Once loaded, these data may be reviewed,
updated, deleted, and simulations may be performed. If "open" is performed while a study was already opened, the former study will be automatically closed.

Expand Down Expand Up @@ -63,13 +63,13 @@ those not selected beforehand.

## Input

- **Name of the study** Give a reference name to the study. The default name is identical to that of
- **Name of the study** Give a reference name to the study. The default name is identical to that of
the study's folder but the user may modify it. The default name of a new study is "no title"

- **Author(s)** Set the study's author(s) name. Default value is "memory"

The other "input" subcommands here below are used to move from one active window to another.
Note that the availability of the __Wind__, __Solar__, and __Renewable__ subcommands depend on the advanced
Note that the availability of the __Wind__, __Solar__, and __Renewable__ subcommands depend on the advanced
parameter *"Renewable Generation modeling"* described in [miscellaneous](08-miscellaneous.md).

- **System Maps**
Expand Down Expand Up @@ -129,7 +129,7 @@ extraction query on any given specific variable (e.g. "monthly amounts of CO2 to
all available years of simulation.

The results of such queries are automatically stored within the output file structures, so as to
be available at very short notice if they have to be examined later in another session (extractions may require
be available at very short notice if they have to be examined later in another session (extractions may require
a significant computer time when there are many Monte-Carlo years to process).

- **Open in Windows Explorer** This command displays the list of available simulation results and allows
Expand All @@ -144,7 +144,7 @@ If hardware resources and simulation settings allow it, simulations benefit from
(see [System requirements](09-system_requirements.md))

- **Time-series Generators** Runs any or all of the Antares stochastic time-series generators,
depending on the values of the parameters set in the "simulation" active window (see [Simulation window](04-active_windows.md#simulation)), and
depending on the values of the parameters set in the "simulation" active window (see [Simulation window](04-active_windows.md#simulation)), and
each cluster's "Generate TS" parameter (see [Thermal window](04-active_windows.md#thermal))

- **Time-series Analyzer** Runs the Antares historical time-series analyzer.
Expand All @@ -164,13 +164,13 @@ the Output data to produce at the end of the simulation, or trimmed from it. In
- **Geographic Trimming** Opens an auxiliary window that allows multiple selection of the results to store at
the end of a simulation: Choice of areas, interconnections, temporal aggregations (hourly, daily, etc.).
Note that in addition to this feature, alternative access to the function is available
(see [Active windows](04-active_windows.md), "output profile"). Geographic Trimming does not reduce actual computation
time but can bring some benefits on total runtime (fewer files to write). Geographic Trimming can save large
(see [Active windows](04-active_windows.md), "output profile"). Geographic Trimming does not reduce actual computation
time but can bring some benefits on total runtime (fewer files to write). Geographic Trimming can save large
amounts of storage space in simulations where only a few Areas and Links are of interest.

- **Regional Districts** Allows selecting a set of areas to bundle them together in a "district".
These are used in the course of simulations to aggregate results over several areas.
They can be given almost any name (a "@" prefix is automatically added by Antares).
- **Regional Districts** Allows selecting a set of areas to bundle them together in a "district".
These are used in the course of simulations to aggregate results over several areas.
They can be given almost any name (a "@" prefix is automatically added by Antares).
Bypassing the GUI is possible (see [Miscellaneous](08-miscellaneous.md)).

- **MC Scenario builder** For each Monte-Carlo year of the simulation defined in the "Simulation" window,
Expand All @@ -180,7 +180,7 @@ the available set (be it ready-made or Antares-generated) _**OR**_ should take a

Regarding Hydro time-series, the scenario builder gives, in addition to the assignment of a specific number to use for the inflows time-series, the ability to define the initial reservoir level to use for each MC year.

- **MC Scenario playlist** For each Monte-Carlo year of the simulation defined in the "Simulation" active window,
- **MC Scenario playlist** For each Monte-Carlo year of the simulation defined in the "Simulation" active window,
this command allows to state whether a MC year prepared for the simulation should be actually simulated or not.
This feature allows, for instance, to refine a previous simulation by excluding a small number of "raw" MC years
whose detailed analysis may have shown that they were not physically realistic. A different typical use consists
Expand All @@ -193,11 +193,11 @@ values of a given variable were encountered in a previous simulation).

- **Optimization preferences** Defines a set of options related to the optimization core used in the simulations.
The set of preferences is study-specific; it can be changed at any time and saved along with study data.
Options refer to objects (binding constraints, etc.) that are presented in subsequent sections of this document.
Options refer to objects (binding constraints, etc.) that are presented in subsequent sections of this document.
The values set in this menu overlay the local parameters but do not change their value: for instance, if the LOCAL
parameter "set to infinite" is activated for some interconnections, and if the GLOBAL preference regarding transmission
parameter "set to infinite" is activated for some interconnections, and if the GLOBAL preference regarding transmission
capacities is "set to null", the simulation will be carried out as if there were no longer any grid BUT the local
values will remain untouched. If the preference is afterwards set to "local values", the interconnections will be
values will remain untouched. If the preference is afterwards set to "local values", the interconnections will be
given back their regular capacities (infinite for those being set on "set to infinite").

- _Binding constraints (include / ignore)_
Expand All @@ -211,9 +211,21 @@ given back their regular capacities (infinite for those being set on "set to inf
- _Export mps (false/true)_
- _Simplex optimization range [^4] (day / week)_
- _Unfeasible problems behavior (Error Dry/ Error Verbose/ Warning Dry/ Warning Verbose_
- _Enable Adequacy patch (false / true)_
- _NTC from physical areas outside to physical areas inside adequacy patch (set to null / local values)_
- _NTC between physical areas outside adequacy patch (set to null / local values)_

- **Adequacy Patch** Auxiliary window [Options] Defines a set of options related to the adequacy patch.
The set of preferences is study-specific; it can be changed at any time and saved along with study data.
Auxiliary window [Areas] Opens a window in which a choice can be made regarding the individual area adequacy patch mode.

- _Enable Adequacy patch (false / true)_
- _NTC from physical areas outside to physical areas inside adequacy patch (set to null / local values)_
- _NTC between physical areas outside adequacy patch (set to null / local values)_
- _Price taking order (DENS / Load)_
- _Include hurdle cost in CSR optimization (false / true)_
- _Check CSR cost function value prior and after CSR (false / true)_
- _Thresholds:_
- _Initiate curtailment sharing rule_
- _Display local maching rule violations_
- _Relax CSR variable boundaries_

- **Advanced parameters** Advanced Parameters allow to adjust the simulation behavior regarding issues
that are more numerical than physical. The set of parameters is study-specific and can be updated at any time.
Expand Down
16 changes: 16 additions & 0 deletions docs/reference-guide/13-file-format.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Study format changes
This is a list of all recent changes that came with new Antares Simulator features. The main goal of this document is to lower the costs of changing existing interfaces, both GUI and scripts.

## v8.5.0
### Input
In file **settings/generaldata.ini**, in section `adequacy patch`, add properties

* `price-taking-order` [string] can take values `DENS` (default value) and `Load`.
* `include-hurdle-cost-csr` [bool]. Default value = `false`
* `check-csr-cost-function` [bool]. Default value = `false`
* `threshold-initiate-curtailment-sharing-rule` [double]. Default value = `0.0`
* `threshold-display-local-matching-rule-violations` [double]. Default value = `0.0`
* `threshold-csr-variable-bounds-relaxation` [int]. Default value = `3`

### Output
* If `include-adq-patch` is set to `true`, add column `LMR VIOL.` in files **values-&lt;period&gt;.txt** (mc-all & mc-ind)
* If `include-adq-patch` is set to `true`, add column `SPIL. ENRG. CSR` in files **values-&lt;period&gt;.txt** (mc-all & mc-ind)
* If `include-adq-patch` is set to `true`, add column `DTG MRG CSR` in files **values-&lt;period&gt;.txt** (mc-all & mc-ind)

## v8.4.0
### Input
#### Zero/infinite capacity for physical links only
Expand Down
Loading

0 comments on commit 1fe63ce

Please sign in to comment.