Skip to content

Commit

Permalink
Write into solution.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Jan 8, 2025
1 parent 42c8da8 commit f93c614
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/solver/modeler/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
*/

#include <fstream>

#include <antares/logs/logs.h>
#include <antares/solver/modeler/api/linearProblemBuilder.h>
#include <antares/solver/modeler/loadFiles/loadFiles.h>
Expand Down Expand Up @@ -84,11 +86,11 @@ int main(int argc, const char** argv)
case Antares::Solver::Modeler::Api::MipStatus::FEASIBLE:
if (!parameters.noOutput)
{
logs.info() << "Variables";
// TODO don't rely on this specific function
logs.info() << "Writing variables...";
std::ofstream sol_out(std::filesystem::current_path() / "solution.csv");
for (const auto& [name, value]: solution->solutionValues())
{
logs.info() << name << " " << value;
sol_out << name << " " << value << std::endl;
}
}
break;
Expand Down

0 comments on commit f93c614

Please sign in to comment.