Antares Simulator
Power System Simulator
hasStatus.h
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 
22 #pragma once
23 #include <optional>
24 
26 {
27 // TODO this is dummy copy of ortools basis status, to avoid including and linking against
28 // that lib
29 enum class MipBasisStatus : unsigned int
30 {
31  FREE = 0,
32  AT_LOWER_BOUND,
33  AT_UPPER_BOUND,
34  FIXED_VALUE,
35  BASIC,
36  NOT_AVAILABLE
37 };
38 
39 inline std::string StatusToString(const std::optional<MipBasisStatus>& status)
40 {
42  // TODO shorten returns
43  if (status.has_value())
44  {
45  switch (*status)
46  {
47  case MipBasisStatus::FREE:
48  return "Free";
49  case MipBasisStatus::AT_LOWER_BOUND:
50  return "At lower bound";
51  case MipBasisStatus::AT_UPPER_BOUND:
52  return "At upper bound";
53  case MipBasisStatus::FIXED_VALUE:
54  return "Fixed value";
55  case MipBasisStatus::BASIC:
56  return "Basic";
57  case MipBasisStatus::NOT_AVAILABLE:
58  default:
59  return "None";
60  }
61  }
62  else
63  {
64  return "None";
65  }
66 }
67 
69 {
70 public:
71  virtual MipBasisStatus getMipBasisStatus() const = 0;
72 };
73 
74 } // namespace Antares::Optimisation::LinearProblemApi
Namespace for the classes related to the linear problem API.
Definition: SimulationTableGenerator.h:41