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

Feature/interface probleme #568

Draft
wants to merge 19 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ endif()
find_package(antares-solver REQUIRED)

#Default RELEASE antares-solver use
get_target_property( ANTARES_SOLVER_PATH antares-${ANTARES_VERSION}-solver IMPORTED_LOCATION_RELEASE )
get_target_property(ANTARES_SOLVER_PATH antares-solver IMPORTED_LOCATION_RELEASE)
if (NOT ANTARES_SOLVER_PATH)
get_target_property( ANTARES_SOLVER_PATH antares-${ANTARES_VERSION}-solver IMPORTED_LOCATION_DEBUG )
get_target_property(ANTARES_SOLVER_PATH antares-solver IMPORTED_LOCATION_DEBUG)
endif()

get_filename_component(ANTARES_SOLVER_DIR ${ANTARES_SOLVER_PATH} DIRECTORY)
Expand Down
2 changes: 1 addition & 1 deletion antares-version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"antares_version": "8.4.0-rc2",
"antares_version": "8.4.0-serialize",
"antares_version_executable": "8.4",
"antares_xpansion_version": "0.8.0",
"antares_deps_version": "2.0.5",
Expand Down
4 changes: 2 additions & 2 deletions data_test/mini_instance_LP/structure.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
master x 0
SP1 x 0
SP2 x 0
SP1.mps x 0
SP2.mps x 0
4 changes: 2 additions & 2 deletions data_test/mini_instance_LP/structure_default_restart.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
master_default_restart x 0
SP1 x 0
SP2 x 0
SP1.mps x 0
SP2.mps x 0
4 changes: 2 additions & 2 deletions data_test/mini_instance_MIP/structure.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
master x 0
SP1 x 0
SP2 x 0
SP1.mps x 0
SP2.mps x 0
4 changes: 2 additions & 2 deletions data_test/mini_instance_MIP/structure_default_restart.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
master_default_restart x 0
SP1 x 0
SP2 x 0
SP1.mps x 0
SP2.mps x 0
4 changes: 2 additions & 2 deletions data_test/mini_instance_UNBOUNDED/structure.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
master x 0
SP1 x 0
SP2 x 0
SP1.mps x 0
SP2.mps x 0
4 changes: 2 additions & 2 deletions data_test/mini_network/slave_weights.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SP1 0.99
SP2 0.01
SP1.mps 0.99
SP2.mps 0.01
WEIGHT_SUM 1.0
8 changes: 4 additions & 4 deletions data_test/mini_network/structure.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
master t 0
master p 1
SP1 t 0
SP1 p 1
SP2 t 0
SP2 p 1
SP1.mps t 0
SP1.mps p 1
SP2.mps t 0
SP2.mps p 1
8 changes: 4 additions & 4 deletions data_test/mini_network/structure_default_restart.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
master_default_restart t 0
master_default_restart p 1
SP1 t 0
SP1 p 1
SP2 t 0
SP2 p 1
SP1.mps t 0
SP1.mps p 1
SP2.mps t 0
SP2.mps p 1
8 changes: 4 additions & 4 deletions data_test/mini_network/structure_weights_restart.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
master_weights_restart t 0
master_weights_restart p 1
SP1 t 0
SP1 p 1
SP2 t 0
SP2 p 1
SP1.mps t 0
SP1.mps p 1
SP2.mps t 0
SP2.mps p 1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
master pv 2
master semibase 3
master transmission_line 4
problem-1-1-20210713-163528 battery 5547
problem-1-1-20210713-163528 peak 5545
problem-1-1-20210713-163528 pv 5548
problem-1-1-20210713-163528 semibase 5546
problem-1-1-20210713-163528 transmission_line 5544
problem-1-1-20210713-163528.mps battery 5547
problem-1-1-20210713-163528.mps peak 5545
problem-1-1-20210713-163528.mps pv 5548
problem-1-1-20210713-163528.mps semibase 5546
problem-1-1-20210713-163528.mps transmission_line 5544
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
master transmission_line 0
problem-1-1-20210720-102450 transmission_line 1848
problem-1-1-20210720-102450.mps transmission_line 1848
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
master transmission_line 0
master transmission_line_2 1
problem-1-1-20210721-145117 transmission_line 1848
problem-1-1-20210721-145117 transmission_line_2 1849
problem-1-1-20210721-145117.mps transmission_line 1848
problem-1-1-20210721-145117.mps transmission_line_2 1849
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
master transmission_line_1 0
master transmission_line_2 1
problem-1-1-20210721-145117 transmission_line_1 1
problem-1-1-20210721-145117 transmission_line_2 2
problem-1-1-20210721-145117.mps transmission_line_1 1
problem-1-1-20210721-145117.mps transmission_line_2 2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
master transmission_line_1 0
master transmission_line_2 1
problem-1-1-20210721-145117 transmission_line_1 3
problem-1-1-20210721-145117 transmission_line_2 4
problem-1-1-20210721-145117.mps transmission_line_1 3
problem-1-1-20210721-145117.mps transmission_line_2 4
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
master transmission_line_1 0
master transmission_line_2 1
problem-1-1-20210721-145117 transmission_line_1 1
problem-1-1-20210721-145117.mps transmission_line_1 1
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
master pv 3
master semibase1 4
master semibase2 5
problem-1-1-20210720-143331 battery 6891
problem-1-1-20210720-143331 peak1 6888
problem-1-1-20210720-143331 peak2 6892
problem-1-1-20210720-143331 pv 6890
problem-1-1-20210720-143331 semibase1 6889
problem-1-1-20210720-143331 semibase2 6893
problem-1-2-20210720-143331 battery 6891
problem-1-2-20210720-143331 peak1 6888
problem-1-2-20210720-143331 peak2 6892
problem-1-2-20210720-143331 pv 6890
problem-1-2-20210720-143331 semibase1 6889
problem-1-2-20210720-143331 semibase2 6893
problem-1-3-20210720-143331 battery 6891
problem-1-3-20210720-143331 peak1 6888
problem-1-3-20210720-143331 peak2 6892
problem-1-3-20210720-143331 pv 6890
problem-1-3-20210720-143331 semibase1 6889
problem-1-3-20210720-143331 semibase2 6893
problem-1-4-20210720-143331 battery 6891
problem-1-4-20210720-143331 peak1 6888
problem-1-4-20210720-143331 peak2 6892
problem-1-4-20210720-143331 pv 6890
problem-1-4-20210720-143331 semibase1 6889
problem-1-4-20210720-143331 semibase2 6893
problem-1-1-20210720-143331.mps battery 6891
problem-1-1-20210720-143331.mps peak1 6888
problem-1-1-20210720-143331.mps peak2 6892
problem-1-1-20210720-143331.mps pv 6890
problem-1-1-20210720-143331.mps semibase1 6889
problem-1-1-20210720-143331.mps semibase2 6893
problem-1-2-20210720-143331.mps battery 6891
problem-1-2-20210720-143331.mps peak1 6888
problem-1-2-20210720-143331.mps peak2 6892
problem-1-2-20210720-143331.mps pv 6890
problem-1-2-20210720-143331.mps semibase1 6889
problem-1-2-20210720-143331.mps semibase2 6893
problem-1-3-20210720-143331.mps battery 6891
problem-1-3-20210720-143331.mps peak1 6888
problem-1-3-20210720-143331.mps peak2 6892
problem-1-3-20210720-143331.mps pv 6890
problem-1-3-20210720-143331.mps semibase1 6889
problem-1-3-20210720-143331.mps semibase2 6893
problem-1-4-20210720-143331.mps battery 6891
problem-1-4-20210720-143331.mps peak1 6888
problem-1-4-20210720-143331.mps peak2 6892
problem-1-4-20210720-143331.mps pv 6890
problem-1-4-20210720-143331.mps semibase1 6889
problem-1-4-20210720-143331.mps semibase2 6893
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
master transmission_line 0
problem-1-1-20210720-114739 transmission_line 1848
problem-1-2-20210720-114739 transmission_line 1848
problem-1-3-20210720-114739 transmission_line 1848
problem-1-4-20210720-114739 transmission_line 1848
problem-1-1-20210720-114739.mps transmission_line 1848
problem-1-2-20210720-114739.mps transmission_line 1848
problem-1-3-20210720-114739.mps transmission_line 1848
problem-1-4-20210720-114739.mps transmission_line 1848
54 changes: 54 additions & 0 deletions fichierDeSerialisation

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/cpp/benders/benders_core/BendersBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ std::string BendersBase::status_from_criterion() const {
*/
std::filesystem::path BendersBase::GetSubproblemPath(
std::string const &slave_name) const {
return std::filesystem::path(_options.INPUTROOT) / (slave_name + MPS_SUFFIX);
return std::filesystem::path(_options.INPUTROOT) / (slave_name);
}

/*!
Expand All @@ -615,8 +615,7 @@ double BendersBase::SubproblemWeight(int subproblem_count,
* \brief Get path to master problem mps file from options
*/
std::filesystem::path BendersBase::get_master_path() const {
return std::filesystem::path(_options.INPUTROOT) /
(_options.MASTER_NAME + MPS_SUFFIX);
return std::filesystem::path(_options.INPUTROOT) / (_options.MASTER_NAME);
}

/*!
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/benders/merge_mps/MergeMPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void MergeMPS::launch() {
auto reader = ArchiveReader(inputRootDir / _options.MPS_ZIP_FILE);
reader.Open();
for (auto const &kvp : input) {
auto problem_name(inputRootDir / (kvp.first + MPS_SUFFIX));
auto problem_name(inputRootDir / (kvp.first));
SolverAbstract::Ptr solver_l = factory.create_solver(solver_to_use);
solver_l->init();
solver_l->set_output_log_level(_options.LOG_LEVEL);
Expand Down
9 changes: 5 additions & 4 deletions src/cpp/exe/lpnamer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
# Problem Generation Exe
# ---------------------------------------------------------------------------

add_executable (lp_namer
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)
add_executable(lp_namer
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)

target_link_libraries (lp_namer
PRIVATE
${PROJECT_NAME}::problem_generation_main
${PROJECT_NAME}::lp_namer_helper)
${PROJECT_NAME}::lp_namer_helper
Boost::serialization)

install(TARGETS lp_namer DESTINATION bin)
1 change: 1 addition & 0 deletions src/cpp/helpers/ArchiveIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ArchiveIO {
explicit ArchiveIO(const std::filesystem::path& archivePath)
: archivePath_(archivePath) {}
ArchiveIO() = default;
virtual ~ArchiveIO() = default;
std::filesystem::path ArchivePath() const { return archivePath_; }
void SetArchivePath(const std::filesystem::path& archivePath) {
archivePath_ = archivePath;
Expand Down
18 changes: 10 additions & 8 deletions src/cpp/lpnamer/input_reader/VariableFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ void updateMapColumn(const std::vector<ActiveLink>& links, int link_id,
}

VariableFileReader::VariableFileReader(
const std::string& fileName, const std::vector<ActiveLink>& links,
const std::filesystem::path& path, const std::vector<ActiveLink>& links,
const VariableFileReadNameConfiguration& variable_name_config,
ProblemGenerationLog::ProblemGenerationLoggerSharedPointer logger)
: logger_(logger) {
std::string line;
std::ifstream file(fileName.c_str());
std::ifstream file(path);
if (!file.good()) {
auto errMsg = std::string("Unable to open '") + fileName + "'";
auto errMsg = std::string("Unable to open '") + path.string() + "'";
(*logger_)(ProblemGenerationLog::LOGLEVEL::FATAL) << errMsg;
throw std::runtime_error(errMsg);
}
Expand All @@ -51,26 +51,28 @@ void VariableFileReader::ReadVarsFromStream(

std::istringstream buffer(line);
colId id;
std::string variable;
std::string type_de_variable;
buffer >> id;
buffer >> variable;
buffer >> type_de_variable;

if (variable == variable_name_config.ntc_variable_name) {
if (type_de_variable == variable_name_config.ntc_variable_name) {
int pays;
int link_id;
int time_step;
buffer >> pays;
buffer >> link_id;
buffer >> time_step;
updateMapColumn(links, link_id, id, time_step, _ntc_p_var_columns);
} else if (variable == variable_name_config.cost_extremite_variable_name) {
} else if (type_de_variable ==
variable_name_config.cost_extremite_variable_name) {
int link_id;
int time_step;
buffer >> link_id;
buffer >> time_step;
updateMapColumn(links, link_id, id, time_step,
_indirect_cost_p_var_columns);
} else if (variable == variable_name_config.cost_origin_variable_name) {
} else if (type_de_variable ==
variable_name_config.cost_origin_variable_name) {
int link_id;
int time_step;
buffer >> link_id;
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/lpnamer/input_reader/VariableFileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct VariableFileReadNameConfiguration {
class VariableFileReader {
public:
VariableFileReader(
const std::string& fileName, const std::vector<ActiveLink>& links,
const std::filesystem::path& path, const std::vector<ActiveLink>& links,
const VariableFileReadNameConfiguration& variable_name_config,
ProblemGenerationLog::ProblemGenerationLoggerSharedPointer logger);
VariableFileReader(
Expand Down
Loading