diff --git a/conception/SequenceDiagrams/FileManipulation/README.md b/conception/SequenceDiagrams/FileManipulation/README.md new file mode 100644 index 000000000..ee7f6db9d --- /dev/null +++ b/conception/SequenceDiagrams/FileManipulation/README.md @@ -0,0 +1,8 @@ +# Sequence diagram focused on folders and files manipulation + +This diagram shows when a folder or a file is manipulated during a full run of xpansion. +It is primarily focused on creation/manipulation, some reading may have been skipped when deemed not needed to appear +here. + +This diagram is not automatically generated, meaning it is an image at some point in time and some evolution in the +project may not have been passed on this document \ No newline at end of file diff --git a/conception/SequenceDiagrams/FileManipulation/diagram.svg b/conception/SequenceDiagrams/FileManipulation/diagram.svg new file mode 100644 index 000000000..13c3c73c9 --- /dev/null +++ b/conception/SequenceDiagrams/FileManipulation/diagram.svg @@ -0,0 +1,1176 @@ + + + title%20Xpansion%20folder%20and%20file%20management%20(full%20run)%0A%0Aparticipantgroup%20%23lightblue%20**Python**%0Aparticipant%20Launch.py%0Aparticipant%20XpansionDriver%0Aparticipant%20AntaresDriver%0Aparticipant%20StudyOutputCleaner%0Aparticipant%20config_loader%0Aparticipant%20problem_generator_driver%0Aparticipant%20full_run_driver%0Aend%0A%0ALaunch.py-%3EXpansionDriver%3Alaunch()%0AXpansionDriver-%3EXpansionDriver%3Alaunch_antares_step()%0Aactivate%20XpansionDriver%0AXpansionDriver-%3EXpansionDriver%3A_backup_general_data_ini%0AXpansionDriver-%3EXpansionDriver%3A_update_general_data_ini%0AXpansionDriver-%3EXpansionDriver%3Aend%20launch_antares_step%0Adeactivate%20XpansionDriver%0AXpansionDriver-%3EAntaresDriver%3ALaunch()%0Aactivate%20AntaresDriver%0AAntaresDriver-%3EAntaresDriver%3A_clear_old_log()%0Anote%20over%20AntaresDriver%3A%20remove%20antares-X.Y-solver.log%0AAntaresDriver-%3EAntaresDriver%3A_set_simulation_name%0Anote%20over%20AntaresDriver%3A%20Get%20last%20modified%20directory%5CnWARNING%20Wrong%20whith%20zipped%20results%0Acreate%20StudyOutputCleaner%0AAntaresDriver-%3EStudyOutputCleaner%3Aclean_antares_step%0AStudyOutputCleaner-%3EStudyOutputCleaner%3ARemove%20Criterion%20files%0Adeactivate%20AntaresDriver%0AAntaresDriver-%3EXpansionDriver%3A%20return%20status%0Aalt%20Antares%20ok%20(return%20false)%0AXpansionDriver-%3EXpansionDriver%3A%20_revert_general_data_ini%0Aelse%20case%20Antares%20NOK%20(return%20true)%0AXpansionDriver-%3EXpansionDriver%3A_backup_general_data_ini_on_error%0AXpansionDriver-%3EXpansionDriver%3A_revert_general_data_ini%0Aelse%20case%20Antares%20Axception%3A%0AXpansionDriver-%3EXpansionDriver%3A_backup_general_data_ini_on_error%0AXpansionDriver-%3EXpansionDriver%3A_revert_general_data_ini%0Aend%0AXpansionDriver-%3Eproblem_generator_driver%3Aset_output_path%0AXpansionDriver-%3Eproblem_generator_driver%3Acreate_lp_dir%0Anote%20over%20problem_generator_driver%3A%20output%2Fsimulation-Xpansion%2Flp%0Aproblem_generator_driver-%3Eproblem_generator_driver%3Aos.makedirs(self._lp_path)%0AXpansionDriver-%3Econfig_loader%3Abenders_pre_actions%0Aconfig_loader-%3Econfig_loader%3Asave_launcher_options%0Anote%20over%20config_loader%3ASave%20command%20line%20options%20in%20output%2Fsimulation-Xpansion%2Flp%2Flauncher_options.json%0Aalt%20Not%20Resume%0Aconfig_loader-%3Econfig_loader%3Acreate_expansion_dir%0Anote%20over%20config_loader%3Arm%2Bcreate%20output%2Fsimulation-Xpansion%2Fexpansion%0Aend%0Aconfig_loader-%3Econfig_loader%3A_set_options_for_benders_solver%0Anote%20over%20config_loader%3A%20write%20options%20in%20output%2Fsimulation-Xpansion%2Flp%2Foptions.json%0AXpansionDriver-%3Efull_run_driver%3Alaunch%0Acreate%20full_run%0Afull_run_driver-%3Efull_run%3Arun%0Aactivate%20full_run%0Anote%20over%20full_run%3A%20log_file_path%20%3D%20output%2Fsimulation-Xpansion%2Flp%2FProblemGenerationLog.txt%0Aparticipantgroup%20%23lightgreen%20**ProblemGeneration**%0Aparticipant%20ProblemGeneration%0Aparticipant%20LpFilesExtractor%0Aparticipant%20ZipProblemProviderAdapter%0Aparticipant%20FilesMapper%0Aend%0A%0Acreate%20ProblemGeneration%0Acreate%20LpFilesExtractor%0Acreate%20ZipProblemProviderAdapter%0Acreate%20FilesMapper%0Afull_run-%3EProblemGeneration%3ARunProblemGeneration%0Aactivate%20ProblemGeneration%0AProblemGeneration-%3EProblemGeneration%3AExtractUtilsFiles%0A%0AProblemGeneration-%3ELpFilesExtractor%3AExtractFiles%0AProblemGeneration-%3EFilesMapper%3AFillMap%0Anote%20over%20FilesMapper%3A%20read%20mps%20file%20list%20from%20zip%20%5Cn%20Fill%20Map%3CPair%3CYear%2C%20Week%3E%2C%20Tuple%3CMPSPAth%2C%20VariablePAth%2C%20ConstraintPath%3E%3E%20%0Adestroyafter%20FilesMapper%0A%0Aalt%20use%20zip%20implementation%20%3D%20true%20%7Bconst%7D%0Aloop%20mps%20files%0AProblemGeneration-%3EZipProblemProviderAdapter%3AProvideProblems%0Anote%20over%20ZipProblemProviderAdapter%3AExtract%20problem%20file%20from%20zip%5Cn%20create%20%22problem%22%2Fsolver%0Aend%0Aloop%20Problems%0AProblemGeneration-%3EProblemGeneration%3Atreat%0Anote%20over%20ProblemGeneration%3A%20write%20mps%0Aend%0Aend%0AProblemGeneration-%3EProblemGeneration%3AMasterGeneration()%0Adeactivateafter%20ProblemGeneration%0Adestroy%20LpFilesExtractor%0Adestroy%20ZipProblemProviderAdapter%0Adestroyafter%20ProblemGeneration%0A%0A%0Aparticipantgroup%20%23lightpink%20**Benders**%0Aparticipant%20BendersFactory%0Aparticipant%20Benders%0Aend%20%0Afull_run-%3EBendersFactory%3ARunBenders%0ABendersFactory-%3EBendersFactory%3ARead%20options%20file%0ABendersFactory-%3EBendersFactory%3ASet%20log%20destination%0Anote%20over%20BendersFactory%3A%20bendersLog-rank%3CN%3E.txt%0ABendersFactory-%3EBendersFactory%3AFileAndStdoutLoggerFactory%0Anote%20over%20BendersFactory%3Alog%20filename%3A%20reportbenders.txt%5Cndestination%3A%20%22.%22%20with%20previous%20chdir%20to%20lp%20dir%0ABendersFactory-%3EBendersFactory%3Aset%20writer%0Anote%20over%20BendersFactory%3A%20write%20in%20simulation-Xpansion%2Fexpansion%2Fout.json%0ABendersFactory-%3EBenders%3Alaunch%0A%0A%0Afull_run-%3Efull_run%3AupdateStudy%0A%0A%0Adeactivateafter%20full_run%0Adestroyafter%20full_run%0Aalt%20not%20keep_mps%0Afull_run_driver-%3EStudyOutputCleaner%3Aclean_benders_step%0Anote%20over%20StudyOutputCleaner%3Arm%20simulation-Xpansion%2Flp%2F*.mps%5Cnrm%20simulation-Xpansion%2Flp%2F*.lp%5Cnrm%20simulation-Xpansion%2Flp%2F*.zip%0Aend%0AXpansionDriver-%3EXpansionDriver%3Aclean_step%0Aactivate%20XpansionDriver%0Acreate%20antares_archive_updater_exe%0AXpansionDriver-%3Eantares_archive_updater_exe%3ARun%0Anote%20over%20antares_archive_updater_exe%3A%20add%20sumulation-Xpansion%20in%20simulation.zip%5Cnrm%20simulation-Xpansion%0Aantares_archive_updater_exe-%3Eantares_archive_updater_exe%3ACleanAntaresArchive%0Adestroyafter%20antares_archive_updater_exe%0Anote%20over%20XpansionDriver%3Arm%20output%2Fsimulation-Xpansion%0Adeactivateafter%20XpansionDriver%0A + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Xpansion folder and file management (full run) + + + + + + + Python + + + + + + ProblemGeneration + + + + + + Benders + + + + + + + + + + + + + + + + + + + + + + + + + + + Launch.py + + + + + + + + XpansionDriver + + + + + + + + AntaresDriver + + + + + + + + config_loader + + + + + + + + problem_generator_driver + + + + + + + + full_run_driver + + + + + + + + BendersFactory + + + + + + + + Benders + + + + + + + + + + launch() + + + + + + + + + launch_antares_step() + + + + + + + + + _backup_general_data_ini + + + + + + + + + _update_general_data_ini + + + + + + + + + end launch_antares_step + + + + + + + + + Launch() + + + + + + + + + _clear_old_log() + + + + + + + + + + remove antares-X.Y-solver.log + + + _set_simulation_name + + + + + + + + + + Get last modified directory + WARNING Wrong whith zipped results + + + + + + + + StudyOutputCleaner + + + clean_antares_step + + + + + + + + + Remove Criterion files + + + + + + + + + return status + + + + + + + + + _revert_general_data_ini + + + + + + + + + _backup_general_data_ini_on_error + + + + + + + + + _revert_general_data_ini + + + + + + + + + _backup_general_data_ini_on_error + + + + + + + + + _revert_general_data_ini + + + + + + + + + set_output_path + + + + + + + + + create_lp_dir + + + + + + + + + + output/simulation-Xpansion/lp + + + os.makedirs(self._lp_path) + + + + + + + + + benders_pre_actions + + + + + + + + + save_launcher_options + + + + + + + + + + Save command line options in output/simulation-Xpansion/lp/launcher_options.json + + + create_expansion_dir + + + + + + + + + + rm+create output/simulation-Xpansion/expansion + + + _set_options_for_benders_solver + + + + + + + + + + write options in output/simulation-Xpansion/lp/options.json + + + launch + + + + + + + + + + + + + + full_run + + + run + + + + + + + + + + log_file_path = output/simulation-Xpansion/lp/ProblemGenerationLog.txt + + + + + + + + ProblemGeneration + + + + + + + + LpFilesExtractor + + + + + + + + ZipProblemProviderAdapter + + + + + + + + FilesMapper + + + RunProblemGeneration + + + + + + + + + ExtractUtilsFiles + + + + + + + + + ExtractFiles + + + + + + + + + FillMap + + + + + + + + + + read mps file list from zip  +  Fill Map<Pair<Year, Week>, Tuple<MPSPAth, VariablePAth, ConstraintPath>>  + + + + + + ProvideProblems + + + + + + + + + + Extract problem file from zip +  create "problem"/solver + + + treat + + + + + + + + + + write mps + + + MasterGeneration() + + + + + + + + + + + + + + + + + + RunBenders + + + + + + + + + Read options file + + + + + + + + + Set log destination + + + + + + + + + + bendersLog-rank<N>.txt + + + FileAndStdoutLoggerFactory + + + + + + + + + + log filename: reportbenders.txt + destination: "." with previous chdir to lp dir + + + set writer + + + + + + + + + + write in simulation-Xpansion/expansion/out.json + + + launch + + + + + + + + + updateStudy + + + + + + + + + + + + clean_benders_step + + + + + + + + + + rm simulation-Xpansion/lp/*.mps + rm simulation-Xpansion/lp/*.lp + rm simulation-Xpansion/lp/*.zip + + + clean_step + + + + + + + + + + + + + + antares_archive_updater_exe + + + Run + + + + + + + + + + add sumulation-Xpansion in simulation.zip + rm simulation-Xpansion + + + CleanAntaresArchive + + + + + + + + + + + + + rm output/simulation-Xpansion + + + + + + alt + + + + [Antares ok (return false)] + + + + + + + + [case Antares NOK (return true)] + + + + + + + + [case Antares Axception:] + + + + + + + + alt + + + + [Not Resume] + + + + + + alt + + + + [use zip implementation = true {const}] + + + + + + loop + + + + [mps files] + + + + + + loop + + + + [Problems] + + + + + + alt + + + + [not keep_mps] + + + + + + + + + + + + \ No newline at end of file diff --git a/conception/SequenceDiagrams/FileManipulation/diagram.txt b/conception/SequenceDiagrams/FileManipulation/diagram.txt new file mode 100644 index 000000000..108693ed1 --- /dev/null +++ b/conception/SequenceDiagrams/FileManipulation/diagram.txt @@ -0,0 +1,127 @@ +title Xpansion folder and file management (full run) + +participantgroup #lightblue **Python** +participant Launch.py +participant XpansionDriver +participant AntaresDriver +participant StudyOutputCleaner +participant config_loader +participant problem_generator_driver +participant full_run_driver +end + +Launch.py->XpansionDriver:launch() +XpansionDriver->XpansionDriver:launch_antares_step() +activate XpansionDriver +XpansionDriver->XpansionDriver:_backup_general_data_ini +XpansionDriver->XpansionDriver:_update_general_data_ini +XpansionDriver->XpansionDriver:end launch_antares_step +deactivate XpansionDriver +XpansionDriver->AntaresDriver:Launch() +activate AntaresDriver +AntaresDriver->AntaresDriver:_clear_old_log() +note over AntaresDriver: remove antares-X.Y-solver.log +AntaresDriver->AntaresDriver:_set_simulation_name +note over AntaresDriver: Get last modified directory\nWARNING Wrong whith zipped results +create StudyOutputCleaner +AntaresDriver->StudyOutputCleaner:clean_antares_step +StudyOutputCleaner->StudyOutputCleaner:Remove Criterion files +deactivate AntaresDriver +AntaresDriver->XpansionDriver: return status +alt Antares ok (return false) +XpansionDriver->XpansionDriver: _revert_general_data_ini +else case Antares NOK (return true) +XpansionDriver->XpansionDriver:_backup_general_data_ini_on_error +XpansionDriver->XpansionDriver:_revert_general_data_ini +else case Antares Axception: +XpansionDriver->XpansionDriver:_backup_general_data_ini_on_error +XpansionDriver->XpansionDriver:_revert_general_data_ini +end +XpansionDriver->problem_generator_driver:set_output_path +XpansionDriver->problem_generator_driver:create_lp_dir +note over problem_generator_driver: output/simulation-Xpansion/lp +problem_generator_driver->problem_generator_driver:os.makedirs(self._lp_path) +XpansionDriver->config_loader:benders_pre_actions +config_loader->config_loader:save_launcher_options +note over config_loader:Save command line options in output/simulation-Xpansion/lp/launcher_options.json +alt Not Resume +config_loader->config_loader:create_expansion_dir +note over config_loader:rm+create output/simulation-Xpansion/expansion +end +config_loader->config_loader:_set_options_for_benders_solver +note over config_loader: write options in output/simulation-Xpansion/lp/options.json +XpansionDriver->full_run_driver:launch +create full_run +full_run_driver->full_run:run +activate full_run +note over full_run: log_file_path = output/simulation-Xpansion/lp/ProblemGenerationLog.txt +participantgroup #lightgreen **ProblemGeneration** +participant ProblemGeneration +participant LpFilesExtractor +participant ZipProblemProviderAdapter +participant FilesMapper +end + +create ProblemGeneration +create LpFilesExtractor +create ZipProblemProviderAdapter +create FilesMapper +full_run->ProblemGeneration:RunProblemGeneration +activate ProblemGeneration +ProblemGeneration->ProblemGeneration:ExtractUtilsFiles + +ProblemGeneration->LpFilesExtractor:ExtractFiles +ProblemGeneration->FilesMapper:FillMap +note over FilesMapper: read mps file list from zip \n Fill Map, Tuple> +destroyafter FilesMapper + +alt use zip implementation = true {const} +loop mps files +ProblemGeneration->ZipProblemProviderAdapter:ProvideProblems +note over ZipProblemProviderAdapter:Extract problem file from zip\n create "problem"/solver +end +loop Problems +ProblemGeneration->ProblemGeneration:treat +note over ProblemGeneration: write mps +end +end +ProblemGeneration->ProblemGeneration:MasterGeneration() +deactivateafter ProblemGeneration +destroy LpFilesExtractor +destroy ZipProblemProviderAdapter +destroyafter ProblemGeneration + + +participantgroup #lightpink **Benders** +participant BendersFactory +participant Benders +end +full_run->BendersFactory:RunBenders +BendersFactory->BendersFactory:Read options file +BendersFactory->BendersFactory:Set log destination +note over BendersFactory: bendersLog-rank.txt +BendersFactory->BendersFactory:FileAndStdoutLoggerFactory +note over BendersFactory:log filename: reportbenders.txt\ndestination: "." with previous chdir to lp dir +BendersFactory->BendersFactory:set writer +note over BendersFactory: write in simulation-Xpansion/expansion/out.json +BendersFactory->Benders:launch + + +full_run->full_run:updateStudy + + +deactivateafter full_run +destroyafter full_run +alt not keep_mps +full_run_driver->StudyOutputCleaner:clean_benders_step +note over StudyOutputCleaner:rm simulation-Xpansion/lp/*.mps\nrm simulation-Xpansion/lp/*.lp\nrm simulation-Xpansion/lp/*.zip +end +XpansionDriver->XpansionDriver:clean_step +activate XpansionDriver +create antares_archive_updater_exe +XpansionDriver->antares_archive_updater_exe:Run +note over antares_archive_updater_exe: add sumulation-Xpansion in simulation.zip\nrm simulation-Xpansion +antares_archive_updater_exe->antares_archive_updater_exe:CleanAntaresArchive +destroyafter antares_archive_updater_exe +note over XpansionDriver:rm output/simulation-Xpansion +deactivateafter XpansionDriver diff --git a/conception/SequenceDiagrams/FullRunCPP/README.md b/conception/SequenceDiagrams/FullRunCPP/README.md new file mode 100644 index 000000000..cb7ab5208 --- /dev/null +++ b/conception/SequenceDiagrams/FullRunCPP/README.md @@ -0,0 +1,7 @@ +# Sequence diagram of full run (cpp part) + +This diagram show the different calls and objects occurring during a full run. +Some non-significant calls have been omitted + +This diagram is not automatically generated, meaning it is an image at some point in time and some evolution in the +project may not have been passed on this document \ No newline at end of file diff --git a/conception/SequenceDiagrams/FullRunCPP/diagram.svg b/conception/SequenceDiagrams/FullRunCPP/diagram.svg new file mode 100644 index 000000000..72e913d99 --- /dev/null +++ b/conception/SequenceDiagrams/FullRunCPP/diagram.svg @@ -0,0 +1,858 @@ + + + title%20CPP%20Full%20run%0Aparticipant%20Main%0Aparticipantgroup%20%23lightblue%20LPNamer%0Aparticipant%20ProblemGeneration%0Aparticipant%20WeightsFileReader%0Aparticipant%20YearlyWeightsWriter%0Aparticipant%20LpFilesExtractor%0Aparticipant%20LinkProblemsGenerator%0Aparticipant%20ZipProblemsProviderAdapter%0Aparticipant%20MPSFileWriter%0Aparticipant%20IProblemVariablesProviderPort%0Aparticipant%20ProblemModifier%0Aend%0AMain-%3EProblemGeneration%3ARunProblemGeneration()%0AProblemGeneration-%3EProblemGeneration%3AValidateMasterFormulation%0Agroup%20ProcessWeight%0AProblemGeneration-%3EWeightsFileReader%3AReadWeights()%0AWeightsFileReader-%3EProblemGeneration%3A%3Aweights_vector%0AProblemGeneration-%3EYearlyWeightsWriter%3AWriteActiveYears()%0Aend%0Adestroyafter%20WeightsFileReader%0Adestroy%20YearlyWeightsWriter%0Agroup%20ExtractUtilsFiles%0AProblemGeneration-%3ELpFilesExtractor%3AExtractArea%0AProblemGeneration-%3ELpFilesExtractor%3AExtractInterco%0AProblemGeneration-%3ELpFilesExtractor%3AExtractTSNumbers%0Aend%20%0Adestroyafter%20LpFilesExtractor%0AProblemGeneration-%3EProblemGeneration%3AGetLinks()%0AProblemGeneration-%3EProblemGeneration%3AReadConstraintsFile()%0A%0A%0Agroup%20getXpansionProblems%0Acreate%20ZipProblemsProviderAdapter%0AProblemGeneration-%3EZipProblemsProviderAdapter%3AprovideProblems()%0AZipProblemsProviderAdapter-%3EProblemGeneration%3AList%20of%20Problem%0Aend%0Adestroy%20ZipProblemsProviderAdapter%0A%0Acreate%20LinkProblemsGenerator%0Acreate%20MPSFileWriter%0Aloop%20Par%0Acreate%20IProblemVariablesProviderPort%0AProblemGeneration-%3ELinkProblemsGenerator%3Atreat()%0ALinkProblemsGenerator-%3EIProblemVariablesProviderPort%3AProvide()%0AIProblemVariablesProviderPort-%3ELinkProblemsGenerator%3AProblemVariables%0Acreate%20ProblemModifier%0ALinkProblemsGenerator-%3EProblemModifier%3AChangeProblem()%0Aloop%20link%0Aloop%20candidates%0ALinkProblemsGenerator-%3EProblemGeneration%3ACouplings%5Bcandidate_name%2C%20problem_name%5D%0Aend%0Aend%0ALinkProblemsGenerator-%3EMPSFileWriter%3AWriteProblem()%0Adestroyafter%20ProblemModifier%0Aend%0Adestroy%20IProblemVariablesProviderPort%0A%0A%0Adestroy%20MPSFileWriter%0Adestroy%20ZipProblemsProviderAdapter%0Adestroy%20LinkProblemsGenerator%0A%0AProblemGeneration-%3EProblemGeneration%3Amaster_generation()%0Adestroyafter%20ProblemGeneration%0A%2F%2F%2F%2F%2F%0Aparticipantgroup%20%23pink%20Benders%0Acreate%20BendersFactrory%0AMain-%3EBendersFactrory%3ARunBenders%0Acreate%20Benders%0ABendersFactrory-%3EBenders%3ALaunch()%0Agroup%20build_input_map()%0ABenders-%3EBenders%3Aget_master_variable_map()%0ABenders-%3EBenders%3AGetCouplingMap()%0Aend%0Agroup%20InitializeProblem%0ABenders-%3EBenders%3AMatchProblemToId%0ABenders-%3EBenders%3ABuildMasterProblem()%0Aloop%20coupling_map%0ABenders-%3EBenders%3AAddSubproblem()%0ABenders-%3EBenders%3AAddSubproblem()%0Aend%0Aend%20%0Agroup%20Run%0Aloop%20CriterionNotReach%0ABenders-%3EBenders%3Asolve_master%0ABenders-%3EBenders%3Asolve_subproblems_and_build_cuts%0ABenders-%3EBenders%3Aupdate_best_solution%0Aend%0Aend%20%0ABenders-%3EBenders%3Apost_run_actions%0Aend%0Adestroyafter%20Benders%0Adestroyafter%20BendersFactrory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CPP Full run + + + + + + + LPNamer + + + + + + Benders + + + + + + + + + + + + + + + + + + + + + + + + Main + + + + + + + + ProblemGeneration + + + + + + + + WeightsFileReader + + + + + + + + YearlyWeightsWriter + + + + + + + + LpFilesExtractor + + + + + RunProblemGeneration() + + + + + + + + + ValidateMasterFormulation + + + + + + + + + ReadWeights() + + + + + + + + + :weights_vector + + + + + + + + + WriteActiveYears() + + + + + + + + + + + + + + + ExtractArea + + + + + + + + + ExtractInterco + + + + + + + + + ExtractTSNumbers + + + + + + + + + + + + GetLinks() + + + + + + + + + ReadConstraintsFile() + + + + + + + + + + + + + + ZipProblemsProviderAdapter + + + provideProblems() + + + + + + + + + List of Problem + + + + + + + + + + + + + + + + + LinkProblemsGenerator + + + + + + + + MPSFileWriter + + + + + + + + IProblemVariablesProviderPort + + + treat() + + + + + + + + + Provide() + + + + + + + + + ProblemVariables + + + + + + + + + + + + + + ProblemModifier + + + ChangeProblem() + + + + + + + + + Couplings[candidate_name, problem_name] + + + + + + + + + WriteProblem() + + + + + + + + + + + + + + + + + + + + + + + + master_generation() + + + + + + + + + + + + + + + + + BendersFactrory + + + RunBenders + + + + + + + + + + + + + + Benders + + + Launch() + + + + + + + + + get_master_variable_map() + + + + + + + + + GetCouplingMap() + + + + + + + + + MatchProblemToId + + + + + + + + + BuildMasterProblem() + + + + + + + + + AddSubproblem() + + + + + + + + + AddSubproblem() + + + + + + + + + solve_master + + + + + + + + + solve_subproblems_and_build_cuts + + + + + + + + + update_best_solution + + + + + + + + + post_run_actions + + + + + + + + + + + + + + + + + + ProcessWeight + + + + + + ExtractUtilsFiles + + + + + + getXpansionProblems + + + + + + loop + + + + [Par] + + + + + + loop + + + + [link] + + + + + + loop + + + + [candidates] + + + + + + build_input_map() + + + + + + InitializeProblem + + + + + + loop + + + + [coupling_map] + + + + + + Run + + + + + + loop + + + + [CriterionNotReach] + + + + + + + + + \ No newline at end of file diff --git a/conception/SequenceDiagrams/FullRunCPP/diagram.txt b/conception/SequenceDiagrams/FullRunCPP/diagram.txt new file mode 100644 index 000000000..47a5b0eb7 --- /dev/null +++ b/conception/SequenceDiagrams/FullRunCPP/diagram.txt @@ -0,0 +1,94 @@ +title CPP Full run +participant Main +participantgroup #lightblue LPNamer +participant ProblemGeneration +participant WeightsFileReader +participant YearlyWeightsWriter +participant LpFilesExtractor +participant LinkProblemsGenerator +participant ZipProblemsProviderAdapter +participant MPSFileWriter +participant IProblemVariablesProviderPort +participant ProblemModifier +end +Main->ProblemGeneration:RunProblemGeneration() +ProblemGeneration->ProblemGeneration:ValidateMasterFormulation +group ProcessWeight +ProblemGeneration->WeightsFileReader:ReadWeights() +WeightsFileReader->ProblemGeneration::weights_vector +ProblemGeneration->YearlyWeightsWriter:WriteActiveYears() +end +destroyafter WeightsFileReader +destroy YearlyWeightsWriter +group ExtractUtilsFiles +ProblemGeneration->LpFilesExtractor:ExtractArea +ProblemGeneration->LpFilesExtractor:ExtractInterco +ProblemGeneration->LpFilesExtractor:ExtractTSNumbers +end +destroyafter LpFilesExtractor +ProblemGeneration->ProblemGeneration:GetLinks() +ProblemGeneration->ProblemGeneration:ReadConstraintsFile() + + +group getXpansionProblems +create ZipProblemsProviderAdapter +ProblemGeneration->ZipProblemsProviderAdapter:provideProblems() +ZipProblemsProviderAdapter->ProblemGeneration:List of Problem +end +destroy ZipProblemsProviderAdapter + +create LinkProblemsGenerator +create MPSFileWriter +loop Par +create IProblemVariablesProviderPort +ProblemGeneration->LinkProblemsGenerator:treat() +LinkProblemsGenerator->IProblemVariablesProviderPort:Provide() +IProblemVariablesProviderPort->LinkProblemsGenerator:ProblemVariables +create ProblemModifier +LinkProblemsGenerator->ProblemModifier:ChangeProblem() +loop link +loop candidates +LinkProblemsGenerator->ProblemGeneration:Couplings[candidate_name, problem_name] +end +end +LinkProblemsGenerator->MPSFileWriter:WriteProblem() +destroyafter ProblemModifier +end +destroy IProblemVariablesProviderPort + + +destroy MPSFileWriter +destroy ZipProblemsProviderAdapter +destroy LinkProblemsGenerator + +ProblemGeneration->ProblemGeneration:master_generation() +destroyafter ProblemGeneration +///// +participantgroup #pink Benders +create BendersFactrory +Main->BendersFactrory:RunBenders +create Benders +BendersFactrory->Benders:Launch() +group build_input_map() +Benders->Benders:get_master_variable_map() +Benders->Benders:GetCouplingMap() +end +group InitializeProblem +Benders->Benders:MatchProblemToId +Benders->Benders:BuildMasterProblem() +loop coupling_map +Benders->Benders:AddSubproblem() +Benders->Benders:AddSubproblem() +end +end +group Run +loop CriterionNotReach +Benders->Benders:solve_master +Benders->Benders:solve_subproblems_and_build_cuts +Benders->Benders:update_best_solution +end +end +Benders->Benders:post_run_actions +end +destroyafter Benders +destroyafter BendersFactrory \ No newline at end of file diff --git a/conception/mergemps_out_example.json b/conception/SimulationOutputs/mergemps_out_example.json similarity index 100% rename from conception/mergemps_out_example.json rename to conception/SimulationOutputs/mergemps_out_example.json diff --git a/conception/out_merge.json b/conception/SimulationOutputs/out_merge.json similarity index 100% rename from conception/out_merge.json rename to conception/SimulationOutputs/out_merge.json diff --git a/conception/out_seq.json b/conception/SimulationOutputs/out_seq.json similarity index 100% rename from conception/out_seq.json rename to conception/SimulationOutputs/out_seq.json diff --git a/conception/output_example.schema.json b/conception/SimulationOutputs/output_example.schema.json similarity index 95% rename from conception/output_example.schema.json rename to conception/SimulationOutputs/output_example.schema.json index f25ba1719..a03c50261 100644 --- a/conception/output_example.schema.json +++ b/conception/SimulationOutputs/output_example.schema.json @@ -1,593 +1,593 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://example.com/object1591364010.json", - "title": "Root", - "type": "object", - "required": [ - "begin", - "end", - "duration", - "nbWeeks", - "antares", - "antares_xpansion", - "options", - "solution" - ], - "optional": [ - "iterations" - ], - "additionalProperties": false, - "properties": { - "begin": { - "$id": "#root/begin", - "title": "Begin", - "type": "string", - "default": "", - "examples": [ - "26-11-2020 11:22:45" - ], - "pattern": "^(\\d{2})-(\\d{2})-(\\d{4}) (\\d{2}):(\\d{2}):(\\d{2})$" - }, - "end": { - "$id": "#root/end", - "title": "End", - "type": "string", - "default": "", - "examples": [ - "26-11-2020 11:22:50" - ], - "pattern": "^(\\d{2})-(\\d{2})-(\\d{4}) (\\d{2}):(\\d{2}):(\\d{2})$" - }, - "duration": { - "$id": "#root/duration", - "title": "Duration", - "type": "number", - "default": 0, - "examples": [ - 12.3 - ] - }, - "nbWeeks": { - "$id": "#root/nbweeks", - "title": "NbWeeks", - "type": "integer", - "default": 0, - "examples": [ - 52 - ] - }, - "antares": { - "$id": "#root/antares", - "title": "Antares", - "type": "object", - "required": [ - "version", - "name" - ], - "properties": { - "version": { - "$id": "#root/antares/version", - "title": "Version", - "type": "string", - "default": "", - "examples": [ - "version" - ], - "pattern": "^.*$" - }, - "name": { - "$id": "#root/antares/name", - "title": "Name", - "type": "string", - "default": "", - "examples": [ - "study_name" - ], - "pattern": "^.*$" - } - } - }, - "antares_xpansion": { - "$id": "#root/antares_xpansion", - "title": "Antares_xpansion", - "type": "object", - "required": [ - "version" - ], - "properties": { - "version": { - "$id": "#root/antares_xpansion/version", - "title": "Version", - "type": "string", - "default": "", - "examples": [ - "2.0.20" - ], - "pattern": "^\\d+\\.\\d+\\.\\d+$" - } - } - } -, - "options": { - "$id": "#root/options", - "title": "options", - "type": "object", - "required": [ - "ACTIVECUTS", - "AGGREGATION", - "BASIS", - "BOUND_ALPHA", - "CSV_NAME", - "JSON_NAME", - "DELETE_CUT", - "GAP", - "INPUTROOT", - "LOG_LEVEL", - "MASTER_NAME", - "MAX_ITERATIONS", - "OUTPUTROOT", - "RAND_AGGREGATION", - "SLAVE_WEIGHT", - "SLAVE_WEIGHT_VALUE", - "STRUCTURE_FILE", - "THRESHOLD_AGGREGATION", - "THRESHOLD_ITERATION", - "TRACE" - ], - "properties": { - "ACTIVECUTS": { - "$id": "#root/options/ACTIVECUTS", - "title": "ACTIVECUTS", - "type": "boolean", - "default": false, - "examples": [ - false - ] - }, - "AGGREGATION": { - "$id": "#root/options/AGGREGATION", - "title": "AGGREGATION", - "type": "boolean", - "default": false, - "examples": [ - false - ] - }, - "BASIS": { - "$id": "#root/options/BASIS", - "title": "BASIS", - "type": "boolean", - "default": true, - "examples": [ - true - ] - }, - "BOUND_ALPHA": { - "$id": "#root/options/BOUND_ALPHA", - "title": "BOUND_ALPHA", - "type": "boolean", - "default": true, - "examples": [ - true - ] - }, - "CSV_NAME": { - "$id": "#root/options/CSV_NAME", - "title": "CSV_NAME", - "type": "string", - "default": "benders_output_trace", - "examples": [ - "benders_output_trace" - ], - "pattern": "^.*$" - }, - "JSON_NAME": { - "$id": "#root/options/JSON_NAME", - "title": "JSON_NAME", - "type": "string", - "default": "out", - "examples": [ - "out" - ], - "pattern": "^.*$" - }, - "DELETE_CUT": { - "$id": "#root/options/DELETE_CUT", - "title": "DELETE_CUT", - "type": "boolean", - "default": false, - "examples": [ - false - ] - }, - "GAP": { - "$id": "#root/options/GAP", - "title": "GAP", - "type": "number", - "default": 1e-06, - "examples": [ - 1e-06 - ] - }, - "INPUTROOT": { - "$id": "#root/options/INPUTROOT", - "title": "INPUTROOT", - "type": "string", - "default": ".", - "examples": [ - "." - ], - "pattern": "^.*$" - }, - "LOG_LEVEL": { - "$id": "#root/options/LOG_LEVEL", - "title": "LOG_LEVEL", - "type": "integer", - "default": 3, - "examples": [ - 3 - ] - }, - "MASTER_NAME": { - "$id": "#root/options/MASTER_NAME", - "title": "MASTER_NAME", - "type": "string", - "default": "master", - "examples": [ - "master" - ], - "pattern": "^.*$" - }, - "MAX_ITERATIONS": { - "$id": "#root/options/MAX_ITERATIONS", - "title": "MAX_ITERATIONS", - "type": "integer", - "default": -1, - "examples": [ - -1 - ] - }, - "OUTPUTROOT": { - "$id": "#root/options/OUTPUTROOT", - "title": "OUTPUTROOT", - "type": "string", - "default": ".", - "examples": [ - "." - ], - "pattern": "^.*$" - }, - "RAND_AGGREGATION": { - "$id": "#root/options/RAND_AGGREGATION", - "title": "RAND_AGGREGATION", - "type": "integer", - "default": 0, - "examples": [ - 0 - ] - }, - "SLAVE_WEIGHT": { - "$id": "#root/options/SLAVE_WEIGHT", - "title": "SLAVE_WEIGHT", - "type": "string", - "default": "CONSTANT", - "examples": [ - "CONSTANT" - ], - "pattern": "^.*$" - }, - "SLAVE_WEIGHT_VALUE": { - "$id": "#root/options/SLAVE_WEIGHT_VALUE", - "title": "SLAVE_WEIGHT_VALUE", - "type": "number", - "default": 1, - "examples": [ - 1.0 - ] - }, - "STRUCTURE_FILE": { - "$id": "#root/options/STRUCTURE_FILE", - "title": "STRUCTURE_FILE", - "type": "string", - "default": "structure.txt", - "examples": [ - "structure.txt" - ], - "pattern": "^.*$" - }, - "THRESHOLD_AGGREGATION": { - "$id": "#root/options/THRESHOLD_AGGREGATION", - "title": "THRESHOLD_AGGREGATION", - "type": "integer", - "default": 0, - "examples": [ - 0 - ] - }, - "THRESHOLD_ITERATION": { - "$id": "#root/options/THRESHOLD_ITERATION", - "title": "THRESHOLD_ITERATION", - "type": "integer", - "default": 0, - "examples": [ - 0 - ] - }, - "TRACE": { - "$id": "#root/options/TRACE", - "title": "TRACE", - "type": "boolean", - "default": true, - "examples": [ - true - ] - } - } - } -, - "iterations": { - "$id": "#root/iterations", - "title": "Iterations", - "type": "object", - "patternProperties": { - "^\\d+": { - "type": "object", - "required": [ - "duration", - "gap", - "investment_cost", - "operational_cost", - "overall_cost", - "relative_gap", - "best_ub", - "ub", - "lb", - "candidates" - ], - "properties": { - "duration": { - "$id": "#root/iterations/1/duration", - "title": "Duration", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "gap": { - "$id": "#root/iterations/1/gap", - "title": "gap", - "type": "number", - "default": 0, - "examples": [ - 100015.15 - ] - }, - "investment_cost": { - "$id": "#root/iterations/1/investment_cost", - "title": "investment_cost", - "type": "number", - "default": 0, - "examples": [ - 5955146100 - ] - }, - "operational_cost": { - "$id": "#root/iterations/1/operational_cost", - "title": "operational_cost", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "overall_cost": { - "$id": "#root/iterations/1/overall_cost", - "title": "overall_cost", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "relative_gap": { - "$id": "#root/iterations/1/relative_gap", - "title": "relative_gap", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "best_ub": { - "$id": "#root/iterations/1/best_ub", - "title": "best_ub", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "ub": { - "$id": "#root/iterations/1/ub", - "title": "ub", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "lb": { - "$id": "#root/iterations/1/lb", - "title": "lb", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "candidates": { - "$id": "#root/iterations/1/candidates", - "title": "candidates", - "type": "array", - "default": [], - "items" : { "$ref" : "#/definitions/candidate_name" } - } - } - } - }, - "additionalProperties": false - }, - "solution": { - "$id": "#root/solution", - "title": "solution", - "type": "object", - "examples": [ - 1 - ], - "default": {}, - "required": [ - "gap", - "investment_cost", - "optimality", - "values" - ], - "optional": [ - "operational_cost", - "overall_cost", - "iteration", - "lb", - "ub" - ], - "properties": { - "gap": { - "$id": "#root/solution/gap", - "title": "gap", - "type": "number", - "default": 0, - "examples": [ - 100015.15 - ] - }, - "lb": { - "$id": "#root/solution/lb", - "title": "lb", - "type": "number", - "default": 0, - "examples": [ - 3.5 - ] - }, - "ub": { - "$id": "#root/solution/ub", - "title": "ub", - "type": "number", - "default": 0, - "examples": [ - 10 - ] - }, - "investment_cost": { - "$id": "#root/solution/investment_cost", - "title": "investment_cost", - "type": "number", - "default": 0, - "examples": [ - 5955146100 - ] - }, - "operational_cost": { - "$id": "#root/solution/operational_cost", - "title": "operational_cost", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "overall_cost": { - "$id": "#root/solution/overall_cost", - "title": "overall_cost", - "type": "number", - "default": 0, - "examples": [ - 0.005 - ] - }, - "iteration": { - "$id": "#root/solution/iteration", - "title": "iteration", - "type": "integer", - "default": 0, - "examples": [ - 2 - ] - }, - "optimality": { - "$id": "#root/solution/optimality", - "title": "optimality", - "type": "boolean", - "default": false, - "examples": [ - false - ] - }, - "values": { - "$id": "#root/solution/values", - "title": "values", - "type": "object", - "default": {}, - "additionalProperties": { - "type": "number" - } - } - } - } - }, - "definitions": { - "candidate_name": { - "title": "Candidate", - "type": "object", - "required": [ - "name", - "invest", - "min", - "max" - ], - "properties": { - "name" : { - "title": "Name", - "type": "string", - "examples": [ - "Candidate_A" - ] - }, - "invest": { - "title": "Invest", - "type": "number", - "examples": [ - 1 - ], - "default": 0 - }, - "min": { - "title": "Min", - "type": "number", - "examples": [ - 0 - ], - "default": 0 - }, - "max": { - "title": "Max", - "type": "number", - "examples": [ - 1200 - ], - "default": 0 - } - } - } - } -} +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://example.com/object1591364010.json", + "title": "Root", + "type": "object", + "required": [ + "begin", + "end", + "duration", + "nbWeeks", + "antares", + "antares_xpansion", + "options", + "solution" + ], + "optional": [ + "iterations" + ], + "additionalProperties": false, + "properties": { + "begin": { + "$id": "#root/begin", + "title": "Begin", + "type": "string", + "default": "", + "examples": [ + "26-11-2020 11:22:45" + ], + "pattern": "^(\\d{2})-(\\d{2})-(\\d{4}) (\\d{2}):(\\d{2}):(\\d{2})$" + }, + "end": { + "$id": "#root/end", + "title": "End", + "type": "string", + "default": "", + "examples": [ + "26-11-2020 11:22:50" + ], + "pattern": "^(\\d{2})-(\\d{2})-(\\d{4}) (\\d{2}):(\\d{2}):(\\d{2})$" + }, + "duration": { + "$id": "#root/duration", + "title": "Duration", + "type": "number", + "default": 0, + "examples": [ + 12.3 + ] + }, + "nbWeeks": { + "$id": "#root/nbweeks", + "title": "NbWeeks", + "type": "integer", + "default": 0, + "examples": [ + 52 + ] + }, + "antares": { + "$id": "#root/antares", + "title": "Antares", + "type": "object", + "required": [ + "version", + "name" + ], + "properties": { + "version": { + "$id": "#root/antares/version", + "title": "Version", + "type": "string", + "default": "", + "examples": [ + "version" + ], + "pattern": "^.*$" + }, + "name": { + "$id": "#root/antares/name", + "title": "Name", + "type": "string", + "default": "", + "examples": [ + "study_name" + ], + "pattern": "^.*$" + } + } + }, + "antares_xpansion": { + "$id": "#root/antares_xpansion", + "title": "Antares_xpansion", + "type": "object", + "required": [ + "version" + ], + "properties": { + "version": { + "$id": "#root/antares_xpansion/version", + "title": "Version", + "type": "string", + "default": "", + "examples": [ + "2.0.20" + ], + "pattern": "^\\d+\\.\\d+\\.\\d+$" + } + } + } +, + "options": { + "$id": "#root/options", + "title": "options", + "type": "object", + "required": [ + "ACTIVECUTS", + "AGGREGATION", + "BASIS", + "BOUND_ALPHA", + "CSV_NAME", + "JSON_NAME", + "DELETE_CUT", + "GAP", + "INPUTROOT", + "LOG_LEVEL", + "MASTER_NAME", + "MAX_ITERATIONS", + "OUTPUTROOT", + "RAND_AGGREGATION", + "SLAVE_WEIGHT", + "SLAVE_WEIGHT_VALUE", + "STRUCTURE_FILE", + "THRESHOLD_AGGREGATION", + "THRESHOLD_ITERATION", + "TRACE" + ], + "properties": { + "ACTIVECUTS": { + "$id": "#root/options/ACTIVECUTS", + "title": "ACTIVECUTS", + "type": "boolean", + "default": false, + "examples": [ + false + ] + }, + "AGGREGATION": { + "$id": "#root/options/AGGREGATION", + "title": "AGGREGATION", + "type": "boolean", + "default": false, + "examples": [ + false + ] + }, + "BASIS": { + "$id": "#root/options/BASIS", + "title": "BASIS", + "type": "boolean", + "default": true, + "examples": [ + true + ] + }, + "BOUND_ALPHA": { + "$id": "#root/options/BOUND_ALPHA", + "title": "BOUND_ALPHA", + "type": "boolean", + "default": true, + "examples": [ + true + ] + }, + "CSV_NAME": { + "$id": "#root/options/CSV_NAME", + "title": "CSV_NAME", + "type": "string", + "default": "benders_output_trace", + "examples": [ + "benders_output_trace" + ], + "pattern": "^.*$" + }, + "JSON_NAME": { + "$id": "#root/options/JSON_NAME", + "title": "JSON_NAME", + "type": "string", + "default": "out", + "examples": [ + "out" + ], + "pattern": "^.*$" + }, + "DELETE_CUT": { + "$id": "#root/options/DELETE_CUT", + "title": "DELETE_CUT", + "type": "boolean", + "default": false, + "examples": [ + false + ] + }, + "GAP": { + "$id": "#root/options/GAP", + "title": "GAP", + "type": "number", + "default": 1e-06, + "examples": [ + 1e-06 + ] + }, + "INPUTROOT": { + "$id": "#root/options/INPUTROOT", + "title": "INPUTROOT", + "type": "string", + "default": ".", + "examples": [ + "." + ], + "pattern": "^.*$" + }, + "LOG_LEVEL": { + "$id": "#root/options/LOG_LEVEL", + "title": "LOG_LEVEL", + "type": "integer", + "default": 3, + "examples": [ + 3 + ] + }, + "MASTER_NAME": { + "$id": "#root/options/MASTER_NAME", + "title": "MASTER_NAME", + "type": "string", + "default": "master", + "examples": [ + "master" + ], + "pattern": "^.*$" + }, + "MAX_ITERATIONS": { + "$id": "#root/options/MAX_ITERATIONS", + "title": "MAX_ITERATIONS", + "type": "integer", + "default": -1, + "examples": [ + -1 + ] + }, + "OUTPUTROOT": { + "$id": "#root/options/OUTPUTROOT", + "title": "OUTPUTROOT", + "type": "string", + "default": ".", + "examples": [ + "." + ], + "pattern": "^.*$" + }, + "RAND_AGGREGATION": { + "$id": "#root/options/RAND_AGGREGATION", + "title": "RAND_AGGREGATION", + "type": "integer", + "default": 0, + "examples": [ + 0 + ] + }, + "SLAVE_WEIGHT": { + "$id": "#root/options/SLAVE_WEIGHT", + "title": "SLAVE_WEIGHT", + "type": "string", + "default": "CONSTANT", + "examples": [ + "CONSTANT" + ], + "pattern": "^.*$" + }, + "SLAVE_WEIGHT_VALUE": { + "$id": "#root/options/SLAVE_WEIGHT_VALUE", + "title": "SLAVE_WEIGHT_VALUE", + "type": "number", + "default": 1, + "examples": [ + 1.0 + ] + }, + "STRUCTURE_FILE": { + "$id": "#root/options/STRUCTURE_FILE", + "title": "STRUCTURE_FILE", + "type": "string", + "default": "structure.txt", + "examples": [ + "structure.txt" + ], + "pattern": "^.*$" + }, + "THRESHOLD_AGGREGATION": { + "$id": "#root/options/THRESHOLD_AGGREGATION", + "title": "THRESHOLD_AGGREGATION", + "type": "integer", + "default": 0, + "examples": [ + 0 + ] + }, + "THRESHOLD_ITERATION": { + "$id": "#root/options/THRESHOLD_ITERATION", + "title": "THRESHOLD_ITERATION", + "type": "integer", + "default": 0, + "examples": [ + 0 + ] + }, + "TRACE": { + "$id": "#root/options/TRACE", + "title": "TRACE", + "type": "boolean", + "default": true, + "examples": [ + true + ] + } + } + } +, + "iterations": { + "$id": "#root/iterations", + "title": "Iterations", + "type": "object", + "patternProperties": { + "^\\d+": { + "type": "object", + "required": [ + "duration", + "gap", + "investment_cost", + "operational_cost", + "overall_cost", + "relative_gap", + "best_ub", + "ub", + "lb", + "candidates" + ], + "properties": { + "duration": { + "$id": "#root/iterations/1/duration", + "title": "Duration", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "gap": { + "$id": "#root/iterations/1/gap", + "title": "gap", + "type": "number", + "default": 0, + "examples": [ + 100015.15 + ] + }, + "investment_cost": { + "$id": "#root/iterations/1/investment_cost", + "title": "investment_cost", + "type": "number", + "default": 0, + "examples": [ + 5955146100 + ] + }, + "operational_cost": { + "$id": "#root/iterations/1/operational_cost", + "title": "operational_cost", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "overall_cost": { + "$id": "#root/iterations/1/overall_cost", + "title": "overall_cost", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "relative_gap": { + "$id": "#root/iterations/1/relative_gap", + "title": "relative_gap", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "best_ub": { + "$id": "#root/iterations/1/best_ub", + "title": "best_ub", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "ub": { + "$id": "#root/iterations/1/ub", + "title": "ub", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "lb": { + "$id": "#root/iterations/1/lb", + "title": "lb", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "candidates": { + "$id": "#root/iterations/1/candidates", + "title": "candidates", + "type": "array", + "default": [], + "items" : { "$ref" : "#/definitions/candidate_name" } + } + } + } + }, + "additionalProperties": false + }, + "solution": { + "$id": "#root/solution", + "title": "solution", + "type": "object", + "examples": [ + 1 + ], + "default": {}, + "required": [ + "gap", + "investment_cost", + "optimality", + "values" + ], + "optional": [ + "operational_cost", + "overall_cost", + "iteration", + "lb", + "ub" + ], + "properties": { + "gap": { + "$id": "#root/solution/gap", + "title": "gap", + "type": "number", + "default": 0, + "examples": [ + 100015.15 + ] + }, + "lb": { + "$id": "#root/solution/lb", + "title": "lb", + "type": "number", + "default": 0, + "examples": [ + 3.5 + ] + }, + "ub": { + "$id": "#root/solution/ub", + "title": "ub", + "type": "number", + "default": 0, + "examples": [ + 10 + ] + }, + "investment_cost": { + "$id": "#root/solution/investment_cost", + "title": "investment_cost", + "type": "number", + "default": 0, + "examples": [ + 5955146100 + ] + }, + "operational_cost": { + "$id": "#root/solution/operational_cost", + "title": "operational_cost", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "overall_cost": { + "$id": "#root/solution/overall_cost", + "title": "overall_cost", + "type": "number", + "default": 0, + "examples": [ + 0.005 + ] + }, + "iteration": { + "$id": "#root/solution/iteration", + "title": "iteration", + "type": "integer", + "default": 0, + "examples": [ + 2 + ] + }, + "optimality": { + "$id": "#root/solution/optimality", + "title": "optimality", + "type": "boolean", + "default": false, + "examples": [ + false + ] + }, + "values": { + "$id": "#root/solution/values", + "title": "values", + "type": "object", + "default": {}, + "additionalProperties": { + "type": "number" + } + } + } + } + }, + "definitions": { + "candidate_name": { + "title": "Candidate", + "type": "object", + "required": [ + "name", + "invest", + "min", + "max" + ], + "properties": { + "name" : { + "title": "Name", + "type": "string", + "examples": [ + "Candidate_A" + ] + }, + "invest": { + "title": "Invest", + "type": "number", + "examples": [ + 1 + ], + "default": 0 + }, + "min": { + "title": "Min", + "type": "number", + "examples": [ + 0 + ], + "default": 0 + }, + "max": { + "title": "Max", + "type": "number", + "examples": [ + 1200 + ], + "default": 0 + } + } + } + } +} diff --git a/conception/sequential_out_example.json b/conception/SimulationOutputs/sequential_out_example.json similarity index 100% rename from conception/sequential_out_example.json rename to conception/SimulationOutputs/sequential_out_example.json