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

DO NOT MERGE - BUILDING EXECUTABLES RTE-I #1832

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
8e73c01
check length limitation in study
Milos-RTEi Nov 2, 2023
51c2d4e
update todo comment - reloadMntGrp - for II phase
Milos-RTEi Nov 2, 2023
aa13037
load MaintenanceGroupRepository
Milos-RTEi Nov 2, 2023
d7e36f0
fix - checks
Milos-RTEi Nov 2, 2023
eaba3e3
fix - save
Milos-RTEi Nov 2, 2023
af0c5e4
update TODO-s
Milos-RTEi Nov 2, 2023
b22f448
add scenario length & number to repository
Milos-RTEi Nov 3, 2023
c945061
save scenario settings to ini file
Milos-RTEi Nov 3, 2023
4c56982
load scenario settings from ini file
Milos-RTEi Nov 3, 2023
204d8a3
add iterator to MaintenanceGroup - we may need it later
Milos-RTEi Nov 7, 2023
6e51c68
ResidualLoadTS -> for phase-II + for opt.problem parameters
Milos-RTEi Nov 7, 2023
add5f32
temporary comments for mnt-ts-generator backbone
Milos-RTEi Nov 7, 2023
58ddac0
small refactor
Milos-RTEi Nov 7, 2023
f2b94f2
todo: do we need calculationOfSpinning ?
Milos-RTEi Nov 7, 2023
290656c
separate thermal-ts-gen into randomized and optimized
Milos-RTEi Nov 7, 2023
2ab7224
loop through mnt-groups-ares-clusters
Milos-RTEi Nov 7, 2023
9ba9617
to be reverted - just trying out something
Milos-RTEi Nov 7, 2023
7fb6060
create structure of OptimizedThermalGenerator class
Milos-RTEi Nov 8, 2023
8c4da71
BIG TODO - TS number not available when ONLY running ts-gen
Milos-RTEi Nov 8, 2023
4ce680c
refactor OptimizedThermalGenerator - include repo inside the class
Milos-RTEi Nov 8, 2023
641c6f6
set default weights to 1.0
Milos-RTEi Nov 8, 2023
d6da905
refactor MaintenanceGroupSaver
Milos-RTEi Nov 8, 2023
7d9918a
refactor MaintenanceGroupLoader
Milos-RTEi Nov 8, 2023
e7e02fc
remove load/save scenario num/length from/to ini file
Milos-RTEi Nov 8, 2023
c44a5e5
avoid study crash - until we remove scenario MaintenanceGroupRepository
Milos-RTEi Nov 8, 2023
be60517
add scenario to parameters
Milos-RTEi Nov 8, 2023
93edd16
scenario num/length functions + create separate section
Milos-RTEi Nov 8, 2023
0cf78c5
add scenario num & length to genera settings ini file
Milos-RTEi Nov 8, 2023
947bb23
remove scenario num & length from MaintenanceGroupRepository
Milos-RTEi Nov 8, 2023
e4d2813
add check if weight can properly be converted to double value in Main…
Milos-RTEi Nov 9, 2023
4aeb34e
improve weight type check in MaintenanceGroupLoader (not only include…
Milos-RTEi Nov 9, 2023
4af822b
refactor OptimizedThermalGenerator & GenerateOptimizedThermalTimeSeries
Milos-RTEi Nov 9, 2023
c341d5e
further refactor OptimizedThermalGenerator & GenerateOptimizedThermal…
Milos-RTEi Nov 10, 2023
c15a77f
refactor - move OptimizedThermalGenerator to separate files
Milos-RTEi Nov 10, 2023
c66ea7e
clean
Milos-RTEi Nov 10, 2023
b1ebf42
add pre-check: interactions between the maintenance planning and othe…
Milos-RTEi Nov 10, 2023
b4d7fce
clang format
Milos-RTEi Nov 10, 2023
c8921b3
small refactor: replace 8760->HOURS_PER_YEAR
Milos-RTEi Nov 10, 2023
94624b5
calculateResidualLoad - I part
Milos-RTEi Nov 10, 2023
75f352b
typo
Milos-RTEi Nov 10, 2023
575b344
cheat - generate TimeSeriesNumbers even if tsGeneratorsOnly=true, if …
Milos-RTEi Nov 10, 2023
20f380e
clean
Milos-RTEi Nov 10, 2023
ad1db76
calculateResidualLoad - II part - NOT TESTED - test on monday
Milos-RTEi Nov 10, 2023
61403d3
fix calculateAverageRenewableTs
Milos-RTEi Nov 13, 2023
a50962f
clean
Milos-RTEi Nov 13, 2023
ae0810d
fix calculateAverageRenewableTs - 2
Milos-RTEi Nov 13, 2023
2d59c60
refactor solver.hxx -> to run-only-ts-gen -> ApplyScenarioBuilderDueT…
Milos-RTEi Nov 13, 2023
96b789c
refactor ApplyScenarioBuilderDueToMaintenancePlanning
Milos-RTEi Nov 13, 2023
5302a71
method calculateTimeHorizonAndStep
Milos-RTEi Nov 13, 2023
fe54194
calculateNumberOfMaintenances
Milos-RTEi Nov 13, 2023
bda47a4
calculateMaintenanceGroupENSandSpillageCost
Milos-RTEi Nov 13, 2023
bb31402
calculateMaxUnitOutput & calculateDailySums
Milos-RTEi Nov 13, 2023
d1a891f
calculateAverageMaintenanceDuration - TODO
Milos-RTEi Nov 13, 2023
c672bdf
calculateAverageMaintenanceDuration implement
Milos-RTEi Nov 13, 2023
6af2a8e
re-arrange methods for better readability
Milos-RTEi Nov 13, 2023
f480e32
calculateUnit[Latest/Earliest]StartOfFirstMaintenance
Milos-RTEi Nov 13, 2023
41563d6
clang format
Milos-RTEi Nov 13, 2023
aa07321
in addition to inheritance, lets juts make OptimizedThermalGenerator …
Milos-RTEi Nov 14, 2023
afcd241
refactor - create separate generator for each mnt group - easier to m…
Milos-RTEi Nov 14, 2023
75f2b84
refactor - setMaintenanceGroupParameters
Milos-RTEi Nov 14, 2023
d71fb08
update call to calculateNumberOfMaintenances
Milos-RTEi Nov 14, 2023
97f0972
add checks before loops - add loops per scenario nad per length
Milos-RTEi Nov 14, 2023
492d8c8
clean
Milos-RTEi Nov 14, 2023
be54e64
create opt problem formulation structure files
Milos-RTEi Nov 14, 2023
99dabaa
refactor - class OptProblemSettings
Milos-RTEi Nov 14, 2023
7c0dd5b
add auxillary method dayOfTheYear
Milos-RTEi Nov 14, 2023
28cf562
clean
Milos-RTEi Nov 14, 2023
30a492e
create OptimizationProblemVariableIndexes
Milos-RTEi Nov 14, 2023
d1383f4
improve checks
Milos-RTEi Nov 14, 2023
0c2834b
earliest/latest start of the first maintenance TODO
Milos-RTEi Nov 16, 2023
95cba2e
add static - minNumberOfMaintenances
Milos-RTEi Nov 17, 2023
878a41b
fix calculateUnit[Earliest/Latest]StartOfFirstMaintenance methods
Milos-RTEi Nov 17, 2023
1ad0802
clean
Milos-RTEi Nov 17, 2023
d1a6ba9
initialize MILP solver called CBC (ortools family)
Milos-RTEi Nov 17, 2023
6402aa4
refactor/fix OptimizedThermalGenerator destructor
Milos-RTEi Nov 17, 2023
d30f132
refactor initialize MPSolver - which one is better - maybe revert to …
Milos-RTEi Nov 17, 2023
8d0c7d7
add solver infinity to the OptimizedThermalGenerator
Milos-RTEi Nov 17, 2023
3dc3427
clean
Milos-RTEi Nov 17, 2023
a1b657a
test CBC solver on dummy MILP case - works!
Milos-RTEi Nov 17, 2023
cae2b52
add some instructions comments
Milos-RTEi Nov 17, 2023
55b0641
access/set MPSolver parameters
Milos-RTEi Nov 20, 2023
510c659
redefine OptimizationProblemVariables struct
Milos-RTEi Nov 20, 2023
daadbd9
ens & spill variable bounds
Milos-RTEi Nov 20, 2023
adf7657
typo
Milos-RTEi Nov 20, 2023
a9c7b7a
redefine OptimizationProblemVariables
Milos-RTEi Nov 20, 2023
469f0b8
reset problem
Milos-RTEi Nov 20, 2023
b6379c8
refactor + create P[t][u] variables + print out variables for debug
Milos-RTEi Nov 20, 2023
d5e6a4a
refactor calculateNumberOfMaintenances
Milos-RTEi Nov 20, 2023
8d768f4
create start & end variables
Milos-RTEi Nov 20, 2023
dea7b3a
set boundaries
Milos-RTEi Nov 20, 2023
047e41b
refactor
Milos-RTEi Nov 20, 2023
7d5c524
improve printAllVariables
Milos-RTEi Nov 20, 2023
49b4951
set problem cost - ens & spill + print out cost
Milos-RTEi Nov 21, 2023
29a9993
set problem cost - power output
Milos-RTEi Nov 21, 2023
0e6dacb
refactor set objective cost - add optSett due to cluster power cost c…
Milos-RTEi Nov 21, 2023
a202e5b
calculateUnitPowerCost - structure [WIP]
Milos-RTEi Nov 21, 2023
6bb6bbb
create DailyClusterData structure
Milos-RTEi Nov 21, 2023
9882ff0
calculateAvrUnitDailyCost [WIP]
Milos-RTEi Nov 21, 2023
f826191
getters for cluster daily output and cost
Milos-RTEi Nov 21, 2023
56fb3f1
setClusterDailyValues - not checked!
Milos-RTEi Nov 21, 2023
5fa408c
clean & refactor + tested setClusterDailyValues-OK
Milos-RTEi Nov 21, 2023
29ed5c5
refactor - move parameters calc methods to separate cpp file
Milos-RTEi Nov 22, 2023
f8a386a
refactor createVariables
Milos-RTEi Nov 22, 2023
13e508a
improve calculateNumberOfMaintenances
Milos-RTEi Nov 22, 2023
2e482f7
refactor - override method names - simpler
Milos-RTEi Nov 22, 2023
93929dd
improve calculateUnitLatest/EarliestStartOfFirstMaintenance
Milos-RTEi Nov 22, 2023
9ca71b3
setFirstMntStartBounds
Milos-RTEi Nov 22, 2023
a8699f3
store daysSinceLastMaintenance locally - since we are going to update…
Milos-RTEi Nov 22, 2023
30afaed
fix setFirstMntStartBounds + print out
Milos-RTEi Nov 22, 2023
96bc28c
improve calculateUnitEarliestStartOfFirstMaintenance
Milos-RTEi Nov 22, 2023
e12f0ab
refactor fixBounds - [WIP]
Milos-RTEi Nov 22, 2023
a01c434
clean
Milos-RTEi Nov 22, 2023
c13ba09
clean
Milos-RTEi Nov 22, 2023
35d0ab4
fixBounds - tested OK
Milos-RTEi Nov 22, 2023
df8a260
typo
Milos-RTEi Nov 22, 2023
1250c12
rename
Milos-RTEi Nov 22, 2023
70627e9
add scenario number and solved trigger to optSett
Milos-RTEi Nov 22, 2023
b282072
improve main scenario/step loop
Milos-RTEi Nov 22, 2023
c86c8bf
add comments
Milos-RTEi Nov 22, 2023
2962d27
small refactor
Milos-RTEi Nov 22, 2023
e932e98
fixVariableBounds - refactor + rename + add last one
Milos-RTEi Nov 22, 2023
c555a1d
add numberOfMaintenances & averageMaintenanceDuration to DailyCluste…
Milos-RTEi Nov 22, 2023
bde9e5d
call getters instead of calculate - avoid numerous recalculation
Milos-RTEi Nov 22, 2023
6b46918
refactor
Milos-RTEi Nov 22, 2023
5455baa
renaming + more getters
Milos-RTEi Nov 23, 2023
c4ebbdb
refactor create P var - create by all days first
Milos-RTEi Nov 23, 2023
603185c
clean-refactor
Milos-RTEi Nov 23, 2023
87b773c
refactor build start/end vars - all days first
Milos-RTEi Nov 23, 2023
2dc9f4c
setLoadBalanceConstraints + print
Milos-RTEi Nov 23, 2023
35be8fd
improve debug printing constraints
Milos-RTEi Nov 23, 2023
b62d143
deltaSolver for <= & >= constraints
Milos-RTEi Nov 23, 2023
ac54c53
setMaxUnitOutputConstraints - tested
Milos-RTEi Nov 23, 2023
7f9497c
adjust max output constraint if cluster/unit is not in maintenance ju…
Milos-RTEi Nov 23, 2023
3718dcf
fix comments
Milos-RTEi Nov 23, 2023
76c18c3
maybe idea for refactoring phase-II
Milos-RTEi Nov 23, 2023
4272581
setStartEndMntLogicConstraints - tested one by one - works - solver w…
Milos-RTEi Nov 23, 2023
464632d
clean + comments
Milos-RTEi Nov 24, 2023
3bff790
clean/refactor - move all print to separate file
Milos-RTEi Nov 24, 2023
7e4253b
clean
Milos-RTEi Nov 24, 2023
9ebc70e
printResults method - for debugging purpose - result tested - seems l…
Milos-RTEi Nov 24, 2023
b5a4a4a
re-naming
Milos-RTEi Nov 24, 2023
6ffe65e
refactor+comments
Milos-RTEi Nov 24, 2023
8ccc3c2
refactor
Milos-RTEi Nov 24, 2023
ad5edd3
HUGE refactor - re-define var structure and all the loops
Milos-RTEi Nov 26, 2023
80ad7da
update auxiliary structures due to future use
Milos-RTEi Nov 26, 2023
0b646e9
add separate cpp-s for post optimization
Milos-RTEi Nov 26, 2023
6eca1cb
structure for postScenarioOptimization
Milos-RTEi Nov 26, 2023
1bb69bc
post-timeStep optimization struct
Milos-RTEi Nov 26, 2023
07faba8
comments
Milos-RTEi Nov 26, 2023
427b341
post scenario optimization clear storage
Milos-RTEi Nov 26, 2023
a9099ca
add comments in OptimizedGenerator for clearer picture
Milos-RTEi Nov 26, 2023
3c1a9e1
TODO-s refactoring ideas
Milos-RTEi Nov 26, 2023
1ca156f
create instance for appending scenario results step by step
Milos-RTEi Nov 26, 2023
8ded34c
update todo comments
Milos-RTEi Nov 26, 2023
739b720
extract auxiliary methods out of the class
Milos-RTEi Nov 26, 2023
998aba1
move calculate Average time-series functions out of class
Milos-RTEi Nov 26, 2023
5eaca86
extract 2 calculate parameters methods - per cluster out of the class
Milos-RTEi Nov 26, 2023
6af86e9
move second part of calculate parameters methods - per cluster out of…
Milos-RTEi Nov 26, 2023
3b96580
move free functions definition to separate cpp
Milos-RTEi Nov 26, 2023
e567fcf
make header file for auxillary functions
Milos-RTEi Nov 26, 2023
941dbc7
assert
Milos-RTEi Nov 26, 2023
4891b6b
future tips
Milos-RTEi Nov 26, 2023
7b0fbc7
auxillary function findFirstOne in vector
Milos-RTEi Nov 27, 2023
8964fa6
fix populating scenarioResults while creating variables
Milos-RTEi Nov 27, 2023
3e317f1
appendTimeStepResults - collect mnt start values
Milos-RTEi Nov 27, 2023
222f672
draw random maintenance duration [WIP]
Milos-RTEi Nov 27, 2023
7690241
draw random maintenance duration
Milos-RTEi Nov 27, 2023
049d8c5
refactor - calculate and store all cluster data for rand gen before l…
Milos-RTEi Nov 27, 2023
fbbd40a
small refactor
Milos-RTEi Nov 27, 2023
481779c
re-calculate days since last mnt [WIP]
Milos-RTEi Nov 27, 2023
1d6d120
rename-refactor
Milos-RTEi Nov 28, 2023
f152726
writeTsResults - final call after all scenarios - includes: derated, …
Milos-RTEi Nov 28, 2023
df1a047
post scenario optimization auxillary functions [WIP] - expandAndMean
Milos-RTEi Nov 28, 2023
44a9eca
refactor availableDailyPower
Milos-RTEi Nov 28, 2023
631503d
upgrade calculateAvailableDailyPower
Milos-RTEi Nov 28, 2023
d6f50f0
fix - reCalculateDaysSinceLastMnt
Milos-RTEi Nov 28, 2023
ed6ed08
TODO
Milos-RTEi Nov 28, 2023
636e282
call and test calculateAvailableDailyPower - ok
Milos-RTEi Nov 28, 2023
5063434
calculateScenarioResults tested ok
Milos-RTEi Nov 28, 2023
fdb7010
small rename
Milos-RTEi Nov 28, 2023
75f0aa5
move reSetDaysSinceLastMnt to postScenario actions
Milos-RTEi Nov 28, 2023
2b231dd
refactor - simplify maintenanceData structure - one loop only
Milos-RTEi Nov 28, 2023
9472bcb
small refactor - simplification in build variables
Milos-RTEi Nov 28, 2023
e28fd38
small refactor
Milos-RTEi Nov 28, 2023
d69175d
saveScenarioResults [WIP]
Milos-RTEi Nov 28, 2023
9e9474e
saveScenarioResults - per cluster - not tested
Milos-RTEi Nov 28, 2023
4a25197
print maintenances - debug only - to be reverted
Milos-RTEi Nov 29, 2023
98c11ef
clean TODOs
Milos-RTEi Nov 29, 2023
026127f
only first maintenance can happen in timeStep - do not loop mnt
Milos-RTEi Nov 29, 2023
48f7327
update comments
Milos-RTEi Nov 29, 2023
95a031b
fix reCalculateDaysSinceLastMnt - as discussed with Hugo - not tested
Milos-RTEi Nov 29, 2023
fb95d39
todo comments
Milos-RTEi Nov 29, 2023
e924a04
improve printing for debug
Milos-RTEi Nov 29, 2023
b713d37
remove unused parameters
Milos-RTEi Nov 29, 2023
1274bb6
print availability vector
Milos-RTEi Nov 29, 2023
58d26c6
Big refactor before changing logic for number of maintenances - check…
Milos-RTEi Nov 29, 2023
98afa15
reminders to remove debug print
Milos-RTEi Nov 29, 2023
cf4c4b2
calculateNumberOfMaintenances - new approach
Milos-RTEi Nov 29, 2023
d03c3bd
reCalculateNumberOfMaintenances
Milos-RTEi Nov 29, 2023
26b2ddf
fix order of caclulating parameters
Milos-RTEi Nov 29, 2023
da2edbe
todo comment
Milos-RTEi Nov 30, 2023
2d54b65
re-name
Milos-RTEi Nov 30, 2023
edff7fc
refactor - wrap up optimization parameters - preparation to make time…
Milos-RTEi Nov 30, 2023
926f762
timeHorizon - is changing - initial calculation
Milos-RTEi Nov 30, 2023
c16ac0b
reCalculateTimeHorizon
Milos-RTEi Nov 30, 2023
6d9ad46
reSetTimeHorizon
Milos-RTEi Nov 30, 2023
a68e6a2
timeHorizon is dynamic now - calculate last day differently
Milos-RTEi Nov 30, 2023
14be2aa
refactor
Milos-RTEi Nov 30, 2023
55ad39d
refactor - pack into sub-folders
Milos-RTEi Nov 30, 2023
9c37f18
move parameters into class
Milos-RTEi Dec 1, 2023
f89b216
move post-optimization to class
Milos-RTEi Dec 1, 2023
c6fddd7
re-name
Milos-RTEi Dec 1, 2023
68981cb
writeTsResults - back to main class
Milos-RTEi Dec 1, 2023
4c02b81
make var & sceRes available to OptimizationParameter class
Milos-RTEi Dec 1, 2023
9d45059
move write results to separate file
Milos-RTEi Dec 1, 2023
f1c0df2
progression++
Milos-RTEi Dec 1, 2023
257ca6a
move print results to OptPar
Milos-RTEi Dec 1, 2023
26f83f6
clang
Milos-RTEi Dec 1, 2023
15f7c09
refactor - simplify Unit::startDay method
Milos-RTEi Dec 1, 2023
6dcb6bb
refactor in order of call
Milos-RTEi Dec 1, 2023
4242256
fix crash when optimize-maintenance = false
Milos-RTEi Dec 1, 2023
781f75b
remove duplicate function definition
Milos-RTEi Dec 1, 2023
4c02e0d
Merge branch 'develop-new' into feature/maintenance-planning-rtei-cr27
Milos-RTEi Dec 1, 2023
f26136c
add limitations
Milos-RTEi Dec 7, 2023
0e91a6a
check timeHorizon after each step
Milos-RTEi Dec 7, 2023
5fe09e1
let daysSinceLast maintenance goes into negative value
Milos-RTEi Dec 7, 2023
6ed802e
make wrong parameters warning - improve log
Milos-RTEi Dec 7, 2023
ae43372
improve logs
Milos-RTEi Dec 7, 2023
457f5b8
bounds-> ct (better solver behavior)
Milos-RTEi Dec 7, 2023
bd5171e
fix - postScenarioOptimization after crash
Milos-RTEi Dec 7, 2023
7e65e89
fix - calc number of maintenances - exclude edge case
Milos-RTEi Dec 7, 2023
66a0b39
Revert "let daysSinceLast maintenance goes into negative value"
Milos-RTEi Dec 7, 2023
9788ccb
fix - std::min(averageDurationBetweenMaintenances - 1, daysSinceLastM…
Milos-RTEi Dec 11, 2023
baa72c4
add pre-check - ts num in simulation must equal sc.len*sc.num
Milos-RTEi Dec 11, 2023
04cf6d2
fix - check
Milos-RTEi Dec 11, 2023
210e6b8
Revert "bounds-> ct (better solver behavior)"
Milos-RTEi Dec 11, 2023
0555850
clean redundant checks
Milos-RTEi Dec 12, 2023
ff04e3d
Update cleaner
nikolaredstork Dec 13, 2023
49e4143
fix time horizon. Add +1 ( when po.win = 0)
Milos-RTEi Dec 14, 2023
a71e84e
Merge branch 'feature/maintenance-planning-rtei-cr27' of https://gith…
Milos-RTEi Dec 14, 2023
51b483a
small improve cause of +1 in timeHorizon
Milos-RTEi Dec 14, 2023
f55f333
move printColumnToFile to aux
Milos-RTEi Dec 19, 2023
236fb36
remove printing
Milos-RTEi Dec 19, 2023
e9f592d
use lowercase for folder names
Milos-RTEi Dec 19, 2023
4d33117
Merge branch 'develop-new' into feature/tmp-maintenance-planning-rte-…
Milos-RTEi Dec 19, 2023
130dc13
try fix - window build fail
Milos-RTEi Dec 19, 2023
8fdbfc7
try fix - shorter name
Milos-RTEi Dec 19, 2023
c123ef7
fix double file
Milos-RTEi Dec 19, 2023
d78f2e2
do not use aux folder name
Milos-RTEi Dec 19, 2023
41b6f16
make it beta
Milos-RTEi Dec 19, 2023
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
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set(ANTARES_VERSION_LO 8)
set(ANTARES_VERSION_REVISION 0)

# Beta release
set(ANTARES_BETA 0)
set(ANTARES_RC 3)
set(ANTARES_BETA 1)
set(ANTARES_RC 0)

set(ANTARES_VERSION_YEAR 2023)

Expand Down
8 changes: 8 additions & 0 deletions src/libs/antares/InfoCollection/StudyInfoCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ void StudyInfoCollector::toFileContent(FileContent& file_content)
performedYearsCountToFileContent(file_content);
enabledThermalClustersCountToFileContent(file_content);
enabledBindingConstraintsCountToFileContent(file_content);
enabledMaintenanceGroupCountToFileContent(file_content);
unitCommitmentModeToFileContent(file_content);
maxNbYearsInParallelToFileContent(file_content);
solverVersionToFileContent(file_content);
Expand Down Expand Up @@ -72,6 +73,13 @@ void StudyInfoCollector::enabledThermalClustersCountToFileContent(FileContent& f
file_content.addItemToSection("study", "enabled thermal clusters", nbEnabledThermalClusters);
}

void StudyInfoCollector::enabledMaintenanceGroupCountToFileContent(FileContent& file_content)
{
auto activeMntGroups = study_.maintenanceGroups.activeMaintenanceGroups();
auto nbEnabledMNT = activeMntGroups.size();
file_content.addItemToSection("study", "enabled Maintenance Group-s", nbEnabledMNT);
}

void StudyInfoCollector::enabledBindingConstraintsCountToFileContent(FileContent& file_content)
{
auto activeContraints = study_.bindingConstraints.activeContraints();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class StudyInfoCollector
void performedYearsCountToFileContent(FileContent& file_content);
void enabledThermalClustersCountToFileContent(FileContent& file_content);
void enabledBindingConstraintsCountToFileContent(FileContent& file_content);
void enabledMaintenanceGroupCountToFileContent(FileContent& file_content);
void unitCommitmentModeToFileContent(FileContent& file_content);
void maxNbYearsInParallelToFileContent(FileContent& file_content);
void solverVersionToFileContent(FileContent& file_content);
Expand Down
3 changes: 3 additions & 0 deletions src/libs/antares/checks/antares/checks/checkLoadedInputData.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ void checkMinStablePower(bool tsGenThermal, const Antares::Data::AreaList& areas
void checkFuelCostColumnNumber(const Antares::Data::AreaList& areas);
void checkCO2CostColumnNumber(const Antares::Data::AreaList& areas);

void checkMaintenancePlanningSettings(const Antares::Data::Parameters* parameters);
void checkMaintenancePlanningTsNum(const Antares::Data::Parameters* parameters);

} // namespace Antares::Check
32 changes: 32 additions & 0 deletions src/libs/antares/checks/checkLoadedInputData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,36 @@ void checkCO2CostColumnNumber(const Antares::Data::AreaList& areas)
&Antares::Data::EconomicInputData::co2cost);
}

void checkMaintenancePlanningSettings(const Antares::Data::Parameters* parameters)
{
const auto timeSeriesToGenerate = parameters->timeSeriesToGenerate;
bool aggregatedMode = parameters->renewableGeneration.isAggregated();

bool activeThermalTSGenAndMntPlanning
= (parameters->maintenancePlanning.isOptimized()
&& (timeSeriesToGenerate & Antares::Data::timeSeriesThermal));

bool activeOtherTSGen
= ((timeSeriesToGenerate & Antares::Data::timeSeriesLoad)
|| (timeSeriesToGenerate & Antares::Data::timeSeriesHydro)
|| ((timeSeriesToGenerate & Antares::Data::timeSeriesWind) && aggregatedMode)
|| ((timeSeriesToGenerate & Antares::Data::timeSeriesSolar) && aggregatedMode));

if (activeThermalTSGenAndMntPlanning && activeOtherTSGen)
throw Error::IncompatibleMaintenancePlanningUsage();
}

void checkMaintenancePlanningTsNum(const Antares::Data::Parameters* parameters)
{
bool activeThermalTSGenAndMntPlanning
= (parameters->maintenancePlanning.isOptimized()
&& (parameters->timeSeriesToGenerate & Antares::Data::timeSeriesThermal));

if (activeThermalTSGenAndMntPlanning
&& parameters->maintenancePlanning.getScenarioLength()
* parameters->maintenancePlanning.getScenarioNumber()
!= parameters->nbTimeSeriesThermal)
throw Error::IncompatibleMaintenancePlanningTsNum();
}

} // namespace Antares::Check
12 changes: 12 additions & 0 deletions src/libs/antares/exception/LoadingError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,17 @@ IncompatibleFuelCostColumns::IncompatibleFuelCostColumns() :
{
}

IncompatibleMaintenancePlanningUsage::IncompatibleMaintenancePlanningUsage() :
LoadingError("When generating thermal time series using Maintenance Planning, Stochastic "
"ts-generator for load, hydro and renewables must be turned off")
{
}

IncompatibleMaintenancePlanningTsNum::IncompatibleMaintenancePlanningTsNum() :
LoadingError("When generating thermal time series using Maintenance Planning, scenario length "
"* scenario number must be equal to number of thermal ts in Stochastic TS")
{
}

} // namespace Error
} // namespace Antares
12 changes: 12 additions & 0 deletions src/libs/antares/exception/antares/exception/LoadingError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,17 @@ class IncompatibleFuelCostColumns : public LoadingError
IncompatibleFuelCostColumns();
};

class IncompatibleMaintenancePlanningUsage : public LoadingError
{
public:
IncompatibleMaintenancePlanningUsage();
};

class IncompatibleMaintenancePlanningTsNum : public LoadingError
{
public:
IncompatibleMaintenancePlanningTsNum();
};

} // namespace Error
} // namespace Antares
2 changes: 1 addition & 1 deletion src/libs/antares/series/include/antares/series/series.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class TimeSeries
void markAsModified() const;
uint64_t memoryUsage() const;

TS timeSeries;
TS timeSeries; // TMP.INFO CR27: TS-s will be written here!
numbers& timeseriesNumbers;

static const std::vector<double> emptyColumn; ///< used in getColumn if timeSeries empty
Expand Down
15 changes: 15 additions & 0 deletions src/libs/antares/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ set(SRC_STUDY_BINDING_CONSTRAINT

source_group("study\\constraint" FILES ${SRC_STUDY_BINDING_CONSTRAINT})

set(SRC_STUDY_MAINTENANCE_PLANNING
maintenance_planning/MaintenanceGroup.h
maintenance_planning/MaintenanceGroup.hxx
maintenance_planning/MaintenanceGroup.cpp
maintenance_planning/MaintenanceGroupSaver.h
maintenance_planning/MaintenanceGroupSaver.cpp
maintenance_planning/MaintenanceGroupLoader.h
maintenance_planning/MaintenanceGroupLoader.cpp
maintenance_planning/MaintenanceGroupRepository.h
maintenance_planning/MaintenanceGroupRepository.cpp
maintenance_planning/MaintenanceGroupRepository.hxx
)

source_group("study\\maintenance" FILES ${SRC_STUDY_MAINTENANCE_PLANNING})

set(SRC_XCAST
xcast.h
Expand Down Expand Up @@ -273,6 +287,7 @@ set(SRC_ALL
${SRC_STUDY_PARAMETERS}
${SRC_STUDY_FINDER}
${SRC_STUDY_BINDING_CONSTRAINT}
${SRC_STUDY_MAINTENANCE_PLANNING}
${SRC_STUDY_PART_WIND}
${SRC_STUDY_PART_HYDRO}
${SRC_STUDY_PART_COMMON}
Expand Down
5 changes: 5 additions & 0 deletions src/libs/antares/study/area/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,11 @@ class AreaList final : public Yuni::NonCopyable<AreaList>
*/
ThermalCluster* findClusterFromINIKey(const AnyString& key);

/*!
** \brief Try to find the area from a given INI key (<area>.'weights')
*/
Area* findAreaFromINIKey(const AnyString& key);

/*!
** \brief Get the total number of interconnections between all areas
*/
Expand Down
16 changes: 16 additions & 0 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ bool AreaList::saveToFolder(const AnyString& folder) const
buffer.clear() << folder << SEP << "input" << SEP << "bindingconstraints";
ret = IO::Directory::Create(buffer) && ret;

buffer.clear() << folder << SEP << "input" << SEP << "maintenanceplanning";
ret = IO::Directory::Create(buffer) && ret;

buffer.clear() << folder << SEP << "input" << SEP << "links";
ret = IO::Directory::Create(buffer) && ret;

Expand Down Expand Up @@ -936,6 +939,7 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
buffer.clear() << study.folderInput << SEP << "thermal" << SEP << "series";
ret = area.thermal.list.loadDataSeriesFromFolder(study, options, buffer) && ret;
ret = area.thermal.list.loadEconomicCosts(study, buffer) && ret;
ret = area.thermal.list.generateRandomDaysSinceLastMaintenance(study) && ret;

// In adequacy mode, all thermal clusters must be in 'mustrun' mode
if (study.usedByTheSolver && study.parameters.mode == SimulationMode::Adequacy)
Expand Down Expand Up @@ -1539,6 +1543,18 @@ ThermalCluster* AreaList::findClusterFromINIKey(const AnyString& key)
return (i != nullptr) ? i : nullptr;
}

Area* AreaList::findAreaFromINIKey(const AnyString& key)
{
if (key.empty())
return nullptr;
auto offset = key.find('.');
if (offset == AreaName::npos || (0 == offset) || (offset == key.size() - 1))
return nullptr;
AreaName parentName(key.c_str(), offset);
Area* parentArea = findFromName(parentName);
return (parentArea != nullptr) ? parentArea : nullptr;
}

void AreaList::updateNameIDSet() const
{
nameidSet.clear();
Expand Down
2 changes: 2 additions & 0 deletions src/libs/antares/study/cleaner/cleaner-v20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ bool listOfFilesAnDirectoriesToKeep(StudyCleaningInfos* infos)
e.add("settings/constraintbuilder.ini");
e.add("settings/scenariobuilder.dat");
e.add("input/bindingconstraints/bindingconstraints.ini");
e.add("input/maintenanceplanning/maintenancegroups.ini");
e.add("input/hydro/hydro.ini");
e.add("input/areas/list.txt");
e.add("input/areas/sets.ini");
Expand Down Expand Up @@ -311,6 +312,7 @@ bool listOfFilesAnDirectoriesToKeep(StudyCleaningInfos* infos)
p.add("settings/resources");
p.add("settings/simulations");
p.add("input/bindingconstraints");
p.add("input/maintenanceplanning");

// Getting all areas
auto* arealist = new AreaList(*study);
Expand Down
14 changes: 14 additions & 0 deletions src/libs/antares/study/fwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,20 @@ const char* RenewableGenerationModellingToCString(RenewableGenerationModelling r
return "";
}

const char* MaintenancePlanningModellingToCString(MaintenancePlanningModelling mtcPlanning)
{
switch (mtcPlanning)
{
case mpRandomized:
return "randomized";
case mpOptimized:
return "optimized";
case mpUnknown:
return "";
}
return "";
}

std::string mpsExportStatusToString(const mpsExportStatus& mps_export_status)
{
switch (mps_export_status)
Expand Down
20 changes: 20 additions & 0 deletions src/libs/antares/study/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,26 @@ const char* RenewableGenerationModellingToCString(RenewableGenerationModelling r
*/
RenewableGenerationModelling StringToRenewableGenerationModelling(const AnyString& text);

/*
* Maintenance Planning
*/
enum MaintenancePlanningModelling
{
mpRandomized = 0, // Default
mpOptimized, // Using Maintenance Planning algorithm
mpUnknown,
};

/*!
** \brief Convert a Maintenance-Planning into a text
*/
const char* MaintenancePlanningModellingToCString(MaintenancePlanningModelling mtcPlanning);

/*!
** \brief Convert a text into a MaintenancePlanningModelling
*/
MaintenancePlanningModelling StringToMaintenancePlanningModelling(const AnyString& text);

// ------------------------
// MPS export status
// ------------------------
Expand Down
10 changes: 10 additions & 0 deletions src/libs/antares/study/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ bool Study::internalLoadFromFolder(const String& path, const StudyLoadOptions& o
ret = internalLoadCorrelationMatrices(options) && ret;
// Binding constraints
ret = internalLoadBindingConstraints(options) && ret;
// Maintenance Group-s
ret = internalLoadMaintenanceGroup(options) && ret;
// Sets of areas & links
ret = internalLoadSets() && ret;

Expand Down Expand Up @@ -268,6 +270,14 @@ bool Study::internalLoadBindingConstraints(const StudyLoadOptions& options)
return (!r && options.loadOnlyNeeded) ? false : r;
}

bool Study::internalLoadMaintenanceGroup(const StudyLoadOptions& options)
{
// All checks are performed in 'loadFromFolder'
buffer.clear() << folderInput << SEP << "maintenanceplanning";
bool r = maintenanceGroups.loadFromFolder(*this, options, buffer);
return (!r && options.loadOnlyNeeded) ? false : r;
}

class SetHandlerAreas
{
public:
Expand Down
Loading
Loading