diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 2c73097adb..daceabc0ff 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -170,6 +170,7 @@ jobs:
run: |
cd _build
ctest -C Release --output-on-failure -L "unit|end-to-end"
+
- name: Upload logs for failed tests
if: ${{ failure() }}
@@ -177,7 +178,7 @@ jobs:
with:
name: test-log
path: ${{ github.workspace }}/_build/Testing/Temporary/LastTest.log
-
+
- name: Run tests about infinity on BCs RHS
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
@@ -185,7 +186,7 @@ jobs:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v830
os: ${{ env.os }}
-
+
- name: Run MILP with CBC
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
@@ -195,6 +196,23 @@ jobs:
variant: "milp-cbc"
os: ${{ env.os }}
+ - name: Run tests on adequacy patch (CSR)
+ if: ${{ env.RUN_SIMPLE_TESTS == 'true' }}
+ uses: ./.github/workflows/run-tests
+ with:
+ simtest-tag: ${{steps.simtest-version.outputs.prop}}
+ batch-name: adequacy-patch-CSR
+ os: ${{ env.os }}
+
+ - name: Run parallel tests
+ if: ${{ env.RUN_EXTENDED_TESTS == 'true' }}
+ uses: ./.github/workflows/run-tests
+ with:
+ simtest-tag: ${{steps.simtest-version.outputs.prop}}
+ batch-name: valid-parallel
+ os: ${{ env.os }}
+ variant: "parallel"
+
- name: Run tests introduced in 8.6.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
@@ -248,14 +266,6 @@ jobs:
batch-name: valid-mps
os: ${{ env.os }}
- - name: Run tests for adequacy patch (CSR)
- if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
- uses: ./.github/workflows/run-tests
- with:
- simtest-tag: ${{ env.SIMTEST }}
- batch-name: adequacy-patch-CSR
- os: ${{ env.os }}
-
- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml
index 5fb4b19603..37d47eaadf 100644
--- a/.github/workflows/windows-vcpkg.yml
+++ b/.github/workflows/windows-vcpkg.yml
@@ -188,6 +188,14 @@ jobs:
batch-name: adequacy-patch-CSR
os: ${{ env.os }}
+ - name: Run tests about infinity on BCs RHS
+ if: ${{ env.RUN_SIMPLE_TESTS == 'true' }}
+ uses: ./.github/workflows/run-tests
+ with:
+ simtest-tag: ${{steps.simtest-version.outputs.prop}}
+ batch-name: valid-v830
+ os: ${{ env.test-platform }}
+
- name: Run tests about infinity on BCs RHS
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
diff --git a/sonar-project.properties b/sonar-project.properties
index 0c74bd252a..d4ba8cce37 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -1,3 +1,24 @@
+#
+# Copyright 2007-2024, RTE (https://www.rte-france.com)
+# See AUTHORS.txt
+# SPDX-License-Identifier: MPL-2.0
+# This file is part of Antares-Simulator,
+# Adequacy and Performance assessment for interconnected energy networks.
+#
+# Antares_Simulator is free software: you can redistribute it and/or modify
+# it under the terms of the Mozilla Public Licence 2.0 as published by
+# the Mozilla Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# Antares_Simulator is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Mozilla Public Licence 2.0 for more details.
+#
+# You should have received a copy of the Mozilla Public Licence 2.0
+# along with Antares_Simulator. If not, see .
+#
+
sonar.projectName=Antares_Simulator
sonar.projectKey=AntaresSimulatorTeam_Antares_Simulator
sonar.organization=antaressimulatorteam
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 56dc5e2bf8..32beee7a3a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,7 +5,6 @@ set(ANTARES_VERSION_HI 9)
set(ANTARES_VERSION_LO 2)
set(ANTARES_VERSION_REVISION 0)
-
# Beta release
set(ANTARES_BETA 0)
set(ANTARES_RC 7)
@@ -192,6 +191,7 @@ endif()
find_package(Boost REQUIRED)
find_package(antlr4-runtime REQUIRED)
+find_package(yaml-cpp REQUIRED)
#Sirius solver
if(POLICY CMP0074)
diff --git a/src/libs/antares/exception/LoadingError.cpp b/src/libs/antares/exception/LoadingError.cpp
index cea447153e..32f4b3b1c1 100644
--- a/src/libs/antares/exception/LoadingError.cpp
+++ b/src/libs/antares/exception/LoadingError.cpp
@@ -96,9 +96,8 @@ InvalidSolverSpecificParameters::InvalidSolverSpecificParameters(const std::stri
{
}
-InvalidStudy::InvalidStudy(const Yuni::String& study):
- LoadingError(std::string("The folder `") + study.c_str()
- + "` does not seem to be a valid study")
+InvalidStudy::InvalidStudy(const std::string& study):
+ LoadingError(std::string("The folder `") + study + "` does not seem to be a valid study")
{
}
diff --git a/src/libs/antares/exception/include/antares/exception/LoadingError.hpp b/src/libs/antares/exception/include/antares/exception/LoadingError.hpp
index d70820e5e9..9a5ff14002 100644
--- a/src/libs/antares/exception/include/antares/exception/LoadingError.hpp
+++ b/src/libs/antares/exception/include/antares/exception/LoadingError.hpp
@@ -140,7 +140,7 @@ class InvalidSolverSpecificParameters: public LoadingError
class InvalidStudy: public LoadingError
{
public:
- explicit InvalidStudy(const Yuni::String& study);
+ explicit InvalidStudy(const std::string& study);
};
class NoStudyProvided: public LoadingError
diff --git a/src/libs/antares/io/CMakeLists.txt b/src/libs/antares/io/CMakeLists.txt
index f2f1eae17d..dc62a95aea 100644
--- a/src/libs/antares/io/CMakeLists.txt
+++ b/src/libs/antares/io/CMakeLists.txt
@@ -14,7 +14,6 @@ add_library(io
)
add_library(Antares::io ALIAS io)
-
target_link_libraries(io
PRIVATE
yuni-static-core
diff --git a/src/libs/antares/io/include/antares/io/file.h b/src/libs/antares/io/include/antares/io/file.h
index b401b1cece..a9aed8c850 100644
--- a/src/libs/antares/io/include/antares/io/file.h
+++ b/src/libs/antares/io/include/antares/io/file.h
@@ -22,8 +22,7 @@
#define __LIBS_ANTARES_IO_FILE_H__
#include
-
-#include
+#include
namespace Antares::IO
{
diff --git a/src/libs/antares/study/CMakeLists.txt b/src/libs/antares/study/CMakeLists.txt
index 29a89fc631..e7336d020c 100644
--- a/src/libs/antares/study/CMakeLists.txt
+++ b/src/libs/antares/study/CMakeLists.txt
@@ -74,8 +74,8 @@ set(SRC_STUDY_PART_THERMAL
include/antares/study/parts/thermal/cost_provider.h
include/antares/study/parts/thermal/cluster.hxx
parts/thermal/cluster.cpp
- parts/thermal/scenarized_cost_provider.cpp
- parts/thermal/constant_cost_provider.cpp
+ parts/thermal/scenarized_cost_provider.cpp
+ parts/thermal/constant_cost_provider.cpp
include/antares/study/parts/thermal/cluster_list.h
parts/thermal/cluster_list.cpp
include/antares/study/parts/thermal/pollutant.h
@@ -102,7 +102,9 @@ set(SRC_STUDY_PART_SHORT_TERM_STORAGE
parts/short-term-storage/series.cpp
include/antares/study/parts/short-term-storage/series.h
include/antares/study/parts/short-term-storage/cluster.h
+ include/antares/study/parts/short-term-storage/AdditionalConstraint.h
parts/short-term-storage/cluster.cpp
+ parts/short-term-storage/AdditionalConstraint.cpp
)
source_group("study\\part\\short-term-storage" FILES ${SRC_STUDY_PART_SHORT_TERM_SOTRAGE})
@@ -306,12 +308,12 @@ target_link_libraries(study
)
target_include_directories(study
- PUBLIC
+ PUBLIC
$
# Make more than just study visible but it's the lesser evil for now
)
-install(DIRECTORY include/antares
+install(DIRECTORY include/antares
DESTINATION "include"
)
diff --git a/src/libs/antares/study/area/list.cpp b/src/libs/antares/study/area/list.cpp
index cf2624515f..7af3a6a5a7 100644
--- a/src/libs/antares/study/area/list.cpp
+++ b/src/libs/antares/study/area/list.cpp
@@ -1199,6 +1199,7 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options)
fs::path folder = stsFolder / "clusters" / area->id.c_str();
ret = area->shortTermStorage.createSTStorageClustersFromIniFile(folder) && ret;
+ ret = area->shortTermStorage.LoadConstraintsFromIniFile(folder) && ret;
}
}
else
diff --git a/src/libs/antares/study/include/antares/study/parts/short-term-storage/AdditionalConstraint.h b/src/libs/antares/study/include/antares/study/parts/short-term-storage/AdditionalConstraint.h
new file mode 100644
index 0000000000..e16b991a05
--- /dev/null
+++ b/src/libs/antares/study/include/antares/study/parts/short-term-storage/AdditionalConstraint.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2007-2024, RTE (https://www.rte-france.com)
+ * See AUTHORS.txt
+ * SPDX-License-Identifier: MPL-2.0
+ * This file is part of Antares-Simulator,
+ * Adequacy and Performance assessment for interconnected energy networks.
+ *
+ * Antares_Simulator is free software: you can redistribute it and/or modify
+ * it under the terms of the Mozilla Public Licence 2.0 as published by
+ * the Mozilla Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Antares_Simulator is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Mozilla Public Licence 2.0 for more details.
+ *
+ * You should have received a copy of the Mozilla Public Licence 2.0
+ * along with Antares_Simulator. If not, see .
+ */
+
+#pragma once
+#include
+#include
+
+namespace Antares::Data::ShortTermStorage
+{
+
+struct AdditionalConstraint
+{
+ std::string name;
+ std::string cluster_id;
+ std::string variable;
+ std::string operatorType;
+ std::set hours;
+ double rhs;
+
+ unsigned int globalIndex = 0;
+
+ struct ValidateResult
+ {
+ bool ok;
+ std::string error_msg;
+ };
+
+ ValidateResult validate() const;
+
+private:
+ bool isValidVariable() const;
+ bool isValidOperatorType() const;
+ bool isValidHoursRange() const;
+};
+} // namespace Antares::Data::ShortTermStorage
diff --git a/src/libs/antares/study/include/antares/study/parts/short-term-storage/cluster.h b/src/libs/antares/study/include/antares/study/parts/short-term-storage/cluster.h
index b4074a28c8..df74a350b0 100644
--- a/src/libs/antares/study/include/antares/study/parts/short-term-storage/cluster.h
+++ b/src/libs/antares/study/include/antares/study/parts/short-term-storage/cluster.h
@@ -26,6 +26,7 @@
#include
+#include "AdditionalConstraint.h"
#include "properties.h"
#include "series.h"
@@ -35,17 +36,21 @@ class STStorageCluster
{
public:
bool enabled() const;
+
bool validate() const;
bool loadFromSection(const IniFile::Section& section);
+
bool loadSeries(const std::filesystem::path& folder) const;
void saveProperties(IniFile& ini) const;
+
bool saveSeries(const std::string& path) const;
std::string id;
std::shared_ptr series = std::make_shared();
mutable Properties properties;
+ std::vector additional_constraints;
};
} // namespace Antares::Data::ShortTermStorage
diff --git a/src/libs/antares/study/include/antares/study/parts/short-term-storage/container.h b/src/libs/antares/study/include/antares/study/parts/short-term-storage/container.h
index 90f8fafbce..d4e0233b5c 100644
--- a/src/libs/antares/study/include/antares/study/parts/short-term-storage/container.h
+++ b/src/libs/antares/study/include/antares/study/parts/short-term-storage/container.h
@@ -21,9 +21,9 @@
#pragma once
#include
-#include