Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop' into featu…
Browse files Browse the repository at this point in the history
…re/antares_in_memory

# Conflicts:
#	src/cpp/full_run/include/FullRunOptionsParser.h
#	src/cpp/lpnamer/input_reader/LpFilesExtractor.cpp
#	src/cpp/lpnamer/input_reader/LpFilesExtractor.h
#	src/cpp/lpnamer/main/ProblemGeneration.cpp
#	src/cpp/lpnamer/main/include/ProblemGeneration.h
#	src/cpp/lpnamer/model/CMakeLists.txt
#	tests/cpp/lp_namer/LpFilesExtractorTest.cpp
#	tests/cpp/lp_namer/ProblemGenerationExeOptionsTest.cpp
#	tests/end_to_end/lpnamer/test_lpnamerEndToEnd.py
  • Loading branch information
JasonMarechal25 committed May 21, 2024
2 parents 6b542c8 + 9f2c7af commit 132e1fa
Show file tree
Hide file tree
Showing 110 changed files with 1,763 additions and 966 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-userguide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}}

- name: upload user guide
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create-user-guide.outputs.pdf-name }}
path: ${{ steps.create-user-guide.outputs.pdf-path }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ jobs:
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=ON \
-DXPRESS=${{ env.XPRESS_VALUE }} \
-DXPRESS_ROOT=${{ env.XPRESSDIR }} \
-DALLOW_RUN_AS_ROOT=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ jobs:
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=OFF \
-DXPRESS=${{ env.XPRESS_VALUE }} \
-DXPRESS_ROOT=${{ env.XPRESSDIR }} \
-DALLOW_RUN_AS_ROOT=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ jobs:
-DCMAKE_INSTALL_PREFIX=_install \
-DBUILD_UI=ON \
-DXPRESS=${{ env.XPRESS_VALUE }} \
-DXPRESS_ROOT=${{ env.XPRESSDIR }} \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Configure
run: |
$pwd=Get-Location
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON -DXPRESS=${{ env.XPRESS_VALUE }} -DXPRESS_ROOT="${{ env.XPRESSDIR }}"
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON -DXPRESS=${{ env.XPRESS_VALUE }}
- name: Build
run: |
cmake --build _build --config Release -j4
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/centos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- name: user guide upload
id: userguide_upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v3 #aligned with download in centOS job
with:
name: user-guide
path: ${{ steps.create-user-guide.outputs.pdf-path }}
Expand Down Expand Up @@ -222,7 +222,6 @@ jobs:
-DBUILD_UI=ON \
-DUSER_GUIDE_PATH="docs/${{ needs.userguide.outputs.pdf-name }}" \
-DXPRESS=${XPRESS_VALUE} \
-DXPRESS_ROOT=${XPRESSDIR} \
-DALLOW_RUN_AS_ROOT=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
doxyfile-path: docs/Doxyfile

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
# If you're changing the branch from main,
# also change the `main` in `refs/heads/main`
# below accordingly.
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/ol8-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: user guide upload
id: userguide_upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: user-guide
path: ${{ steps.create-user-guide.outputs.pdf-path }}
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
pip3 install -r requirements-ui.txt
- name: Download userguide
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: user-guide
path: docs/
Expand Down Expand Up @@ -185,7 +185,6 @@ jobs:
-DBUILD_UI=ON \
-DUSER_GUIDE_PATH="docs/${{ needs.userguide.outputs.pdf-name }}" \
-DXPRESS=${XPRESS_VALUE} \
-DXPRESS_ROOT=${XPRESSDIR} \
-DALLOW_RUN_AS_ROOT=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
Expand Down Expand Up @@ -226,7 +225,7 @@ jobs:
echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV
- name: Upload .tar.gz
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.TGZ_NAME}}
path: _build/${{env.TGZ_NAME}}
Expand All @@ -238,7 +237,7 @@ jobs:
antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}}

- name: Upload single file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create-single-file.outputs.archive-name }}
path: ${{ steps.create-single-file.outputs.archive-path }}
Expand All @@ -263,13 +262,13 @@ jobs:
uses: bruceadams/get-release@main

- name: Download Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{env.ZIP_NAME}}
path: .

- name: Download Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{env.SINGLEFILE_NAME}}
path: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
key: ${{ matrix.os }}-${{ matrix.xprs.value }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ubuntu-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: user guide upload
id: userguide_upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: user-guide
path: ${{ steps.create-user-guide.outputs.pdf-path }}
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
os-full-name: Ubuntu-20.04

- name: Download userguide
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: user-guide
path: docs/
Expand Down Expand Up @@ -179,7 +179,6 @@ jobs:
-DBUILD_UI=ON \
-DUSER_GUIDE_PATH="docs/${{ needs.userguide.outputs.pdf-name }}" \
-DXPRESS=${{ env.XPRESS_VALUE }} \
-DXPRESS_ROOT=${{ env.XPRESSDIR }} \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
Expand Down Expand Up @@ -223,13 +222,13 @@ jobs:
#Uploads are not necessary for release but useful in other cases
- name: Upload .tar.gz
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.TGZ_NAME}}
path: _build/${{env.TGZ_NAME}}

- name: Upload single file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create-single-file.outputs.archive-name }}
path: ${{ steps.create-single-file.outputs.archive-path }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: user guide upload
id: userguide_upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: user-guide
path: ${{ steps.create-user-guide.outputs.pdf-path }}
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
os: ${{matrix.os}}

- name: Download userguide
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: user-guide
path: docs/
Expand All @@ -188,7 +188,7 @@ jobs:
#Inverted ternary : @({'condition is false'},{'condition is true'})[$condition] => ({true}, {false})[!$condition]
run: |
$pwd=Get-Location
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON -DUSER_GUIDE_PATH="docs/${{ needs.userguide.outputs.pdf-name }}" -DXPRESS=${{ env.XPRESS_VALUE }} -DXPRESS_ROOT="${{ env.XPRESSDIR }}"
cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON -DUSER_GUIDE_PATH="docs/${{ needs.userguide.outputs.pdf-name }}" -DXPRESS=${{ env.XPRESS_VALUE }}
- name: Build
run: |
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
echo "VERSION_WITH_XPRESS=$VERSION" >> $GITHUB_ENV
- name: Upload installer
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{env.ZIP_NAME}}
path: _build/${{env.ZIP_NAME}}
Expand All @@ -237,7 +237,7 @@ jobs:
antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}}

- name: Upload single file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create-single-file.outputs.archive-name }}
path: ${{ steps.create-single-file.outputs.archive-path }}
Expand All @@ -262,13 +262,13 @@ jobs:
uses: bruceadams/get-release@main

- name: Download Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{env.ZIP_NAME}}
path: .

- name: Download Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{env.SINGLEFILE_NAME}}
path: .
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ _build
_install
antares-deps
include/google
vcpkg_installed

# Cmake generated files
CMakeCache.txt
Expand All @@ -59,3 +60,7 @@ include/google/protobuf/message.h

# vscode
.vscode

# Local env
.venv
vcpkg_installed
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,15 @@ if (SOLVER)
endif()

find_package(jsoncpp CONFIG REQUIRED)
macro(jsoncpplib_name libname)
if (MSVC)
set(${libname} jsoncpp_lib)
else ()
set(${libname} jsoncpp_static)
endif ()
endmacro()
jsoncpplib_name(jsonlib)
if (MSVC)
set(JSONCPP_LIB jsoncpp_lib)
else ()
set(JSONCPP_LIB jsoncpp_static)
endif ()
message("Using jsoncpp target ${JSONCPP_LIB}")

install(FILES
$<TARGET_FILE:${jsonlib}>
$<TARGET_FILE:${JSONCPP_LIB}>
DESTINATION bin
)

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Antares-Xpansion
> Investment simulations for [Antares][antareswebsite] studies
[![Status][ubuntu_system_svg]][ubuntu_system_link] [![Status][windows_vcpkg_svg]][windows_vcpkg_link] [![Status][centos_system_svg]][centos_system_link] [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AntaresSimulatorTeam_antares-xpansion&metric=alert_status)][sonarcloud_link]
[![Ubuntu CI Status][ubuntu_system_svg]][ubuntu_release] [![Windows CI Status][windows_vcpkg_svg]][windows_vcpkg_link] [![Centos CI Status][centos_system_svg]][centos_system_link][![OL8 CI Status][oracle_svg]][oracle_link] [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=AntaresSimulatorTeam_antares-xpansion&metric=alert_status)][sonarcloud_link]

![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=for-the-badge&logo=c%2B%2B&logoColor=white) ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

Expand Down Expand Up @@ -107,7 +107,7 @@ to drive the execution of multiple executables.

This software suite has been tested under:

* Ubuntu 20.04 [![Status][ubuntu_system_svg]][ubuntu_system_link]
* Ubuntu 20.04 [![Status][ubuntu_system_svg]][ubuntu_release]
* Microsoft Windows with Visual Studio 2019 (64-bit) [![Status][windows_vcpkg_svg]][windows_vcpkg_link]
* Centos 7 [![Status][centos_system_svg]][centos_system_link]

Expand All @@ -126,12 +126,14 @@ For build instructions, please visit the [developer guide][developer-guide].



[ubuntu_system_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/workflows/Ubuntu%20CI%20(system%20libs)/badge.svg
[ubuntu_system_link]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions?query=workflow%3A"Ubuntu%20CI%20(system%20libs)"+branch%3Adevelop
[windows_vcpkg_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/workflows/Windows%20CI%20(VCPKG)/badge.svg
[windows_vcpkg_link]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions?query=workflow%3A"Windows%20CI%20(VCPKG)"+branch%3Adevelop
[centos_system_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/workflows/Centos7%20CI%20(system%20libs)/badge.svg
[centos_system_link]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions?query=workflow%3A"Centos7%20CI%20(system%20libs)"+branch%3Adevelop
[ubuntu_system_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/ubuntu-release.yml/badge.svg?query=branch%3Adevelop
[ubuntu_release]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/ubuntu-release.yml?query=branch%3Adevelop
[windows_vcpkg_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/windows-vcpkg.yml/badge.svg?query=branch%3Adevelop
[windows_vcpkg_link]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/windows-vcpkg.yml?query=branch%3Adevelop
[centos_system_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/centos-release.yml/badge.svg?query=branch%3Adevelop
[centos_system_link]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/centos-release.yml?query=branch%3Adevelop
[oracle_svg]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/ol8-release.yml/badge.svg?query=branch%3Adevelop
[oracle_link]: https://github.com/AntaresSimulatorTeam/antares-xpansion/actions/workflows/ol8-release.yml?query=branch%3Adevelop
[sonarcloud_link]: https://sonarcloud.io/dashboard?id=AntaresSimulatorTeam_antares-xpansion
[antares_xpansion_release_url]: https://github.com/AntaresSimulatorTeam/antares-xpansion/releases

Expand Down
4 changes: 0 additions & 4 deletions data_test/external_loop_test/expansion/.gitignore

This file was deleted.

Empty file.
44 changes: 44 additions & 0 deletions data_test/external_loop_test/lp/description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
We describe a system with 4 nodes, on 1 timestep, 2 scenarios :


|------- N1
|
N0 ----- N2
|
|------- N3

On node 0, there is a generator with :
- Initial P_max = 1
- Prod cost = 1
- Investment cost = 20

On nodes N1, N2, N3, there is a demand that differs between scenarios :
- On N1 : Demand1 = [1, 3]
- On N2 : Demand2 = [3, 3]
- On N3 : Demand3 = [0, 3]

Over the whole system we have :
- Spillage cost = 1
- ENS cost = 10

There are also transmission costs on lines :
- On L01 : transmission cost = 2
- On L02 : transmission cost = 1
- On L03 : transmission cost = 3

As the investment cost is higher than the ENS cost, adding 1MW of capacity would cost 20 to reduce ENS cost only by 10, hence an increased overall cost. Therefore the optimal investment is not to add any capacity beyond the existing one. Given the transmission cost, all flow will get to node 2.

This use case is simple enough so that we can count the number of hours with ENS with respect to the investment. Then we could use this test to check the behavior of any heuristic that aims at reaching a given target of LOLE (not done here).

We add 1 hour of ENS if there is at least 0.1 MWh of unsupplied energy, the "optimal" situation leads to 5h of ENS hours overall, hence 2.5h in expectation.

Each invested capacity will first go to node 2, then to node 1 and finally to node 3 given the transmission costs.

Hence we can deduce the number expected hours of ENS given the total capacity as follows (invested capacity is total capacity - 1 as P_max = 1 initially):
- 0 <= P_max <= 2.9 : 2.5h (1 in area 1, 1 in area 2, 0.5 in area 3)
- 2.9 <= P_max <= 3.9 : 1.5h (1 in area 1, 0 in area 2, 0.5 in area 3)
- 3.9 <= P_max <= 5.9 : 1h (0.5 in area 1, 0 in area 2, 0.5 in area 3)
- 5.9 <= P_max <= 8.9 : 0.5h (0 in area 1, 0 in area 2, 0.5 in area 3)
- 8.9 <= P_max : 0h (0 in area 1, 0 in area 2, 0 in area 3)

Now, to test the heuristic taking into account the reliability constraint we can easily deduce the expected result depending on the criterion. For the test case, we require that all areas have less than 0.5 hours with ENS, hence, the solution is to have a total capacity of 3.9 (i.e. invest 2.9 as P_max = 1 initially)
Loading

0 comments on commit 132e1fa

Please sign in to comment.