Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
ProblemFormat.h
1#pragma once
2
3#include <algorithm>
4#include <stdexcept>
5#include <string>
6
7#include "antares-xpansion/xpansion_interfaces/StringManip.h"
8
9enum class ProblemsFormat
10{
11 MPS_FILE,
12 OPTIMIZED
13};
14
15inline ProblemsFormat problemsFormatFromString(const std::string& str)
16{
17 auto lower_str = StringManip::StringUtils::ToLowercase(str);
18 if (lower_str == "mps")
19 {
20 return ProblemsFormat::MPS_FILE;
21 }
22 if (lower_str == "optimized")
23 {
24 return ProblemsFormat::OPTIMIZED;
25 }
26 throw std::runtime_error("Unknown ProblemsFormat: " + str);
27}