Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
NodeLpDataLocation.h
1#pragma once
2
3#include <filesystem>
4#include <json/value.h>
5#include <string>
6
7#include "antares-xpansion/benders/merge_master_mps/MasterStructureKeys.h"
8
9// We separate this struct to a different file to use it in:
10// - In MergeMasterTrajectoryMPS
11// - In MergeWeightsFileTrajectory
12// - In MultipleProblemGeneration when generating the file (this will ensures validity of a
13// programmatically generated file)
14// -- Both need to read lp folders of nodal studies.
15// Refactor probably needed : regroup merge_master_mps and merge_weights_trajectory perhaps ?
16// (& even multiple_problem_generation ?)
17// In any case, merge_master_mps should probably not be inside benders/
18
19// Contains the paths and filename to the data resulting from --step problem_generation for a given
20// node
22{
23 // Constructor for parsing from NodalLpInfo file
24 explicit NodeLpDataLocation(const Json::Value& data);
25
26 // Initializes a NodeLpDataLocation object with only lp_folder as non default valued
27 explicit NodeLpDataLocation(std::filesystem::path path);
28
29 // Folder containing the generated data
30 std::filesystem::path lp_folder;
31 // Name of the master problem for this node
32 std::string master = MasterStructureKeys::DEFAULT_MASTER_NAME;
33 // Structure file of the node
34 std::string structure = MasterStructureKeys::DEFAULT_STRUCTURE_FILE;
35 // Weights file of the node, might not exist
36 std::string weights = MasterStructureKeys::DEFAULT_WEIGHTS_FILE;
37 bool has_weights_file{false};
38};
39
40using NodesToLpDataLocationMap = std::map<std::string, NodeLpDataLocation>;
41
42namespace LpDataLocationManager
43{
44// Load a nodal_lp_info file
45NodesToLpDataLocationMap parse_nodal_lp_location_file(const std::filesystem::path& file);
46
47void write_nodal_lp_location_file(const NodesToLpDataLocationMap& lp_info_map,
48 const std::filesystem::path& file,
49 const std::filesystem::path& input_root);
50} // namespace LpDataLocationManager
Definition NodeLpDataLocation.h:22