Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ramping model scalian #183

Open
wants to merge 76 commits into
base: New-Antares-Emulator-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a64625a
core implementation of the ramping model
bencamus Dec 5, 2023
b9c4f2b
add export/import features for the thermal ramping attributes
bencamus Dec 7, 2023
624f2ce
make the ramping constraints cyclical as the evolution of the product…
bencamus Dec 18, 2023
915e0c7
remove reference to Yuni in the ramping model code
bencamus Dec 18, 2023
f2d469e
removing of a useless header file
bencamus Dec 18, 2023
e78c034
improve readability of ramping model methods by naming their paramete…
bencamus Dec 18, 2023
b9801fe
add subclass to store and check thermal cluster ramping attributes
bencamus Dec 18, 2023
09a2ca9
Small code improvement for ramping
flomnes Dec 18, 2023
5ce4531
Solve build errors with a friend
flomnes Dec 19, 2023
77daa36
add the possibility to enable/disable the ramping model for each cluster
bencamus Dec 20, 2023
8133150
improvement of the implementation of the ON/OFF ramping model features
bencamus Dec 20, 2023
134ad57
merge commit
bencamus Dec 20, 2023
54ef194
add ramping costs to the output operational costs of the cluster
bencamus Jan 15, 2024
d8ca6aa
add dedicated output log for ramping costs
bencamus Jan 16, 2024
d1f983c
implementation of a new version of the ramping equations
bencamus Feb 29, 2024
70ba583
fixing a bug in the definition of the ramping variables bounds + free…
bencamus Mar 6, 2024
7387013
Supression of clusterRampingVariablesIndex and standardisation of the…
sylvmara Mar 7, 2024
ab1b701
Harmonisation of ramp checking
sylvmara Mar 7, 2024
8b6ce0b
merge with Antares master
bencamus Apr 12, 2024
3b17545
merge last version of ramping model with last version of Antares
bencamus Apr 12, 2024
50f7a48
removing ramping files that are useless with the last version of Antares
bencamus Apr 12, 2024
554455d
changing constraint equation related to power output variation of the…
bencamus Apr 16, 2024
3625bd2
Temporarily enable build for CentOS7
flomnes May 3, 2024
44f722d
changing the variable caption from RAMP COST by plant to RAMP COST BY…
bencamus May 15, 2024
e41d0b8
update the ramping constraint 18ter to remove breaking down thermal u…
bencamus Aug 26, 2024
34f2531
Merge remote-tracking branch 'origin/feature/ramping_model_scalian' i…
bencamus Aug 26, 2024
836be86
merge ramping branch with the develop one
bencamus Sep 25, 2024
c7016fa
remove some debug log for ramping
bencamus Sep 27, 2024
b488581
Set modeler name for logs (instead of [noname]) (#2561)
flomnes Jan 8, 2025
c6e46c8
Fix yaml-cpp target to avoid cmake warnings (#2564)
payetvin Jan 8, 2025
4cb902d
Add variable MRG PRICE CSR in 9.2 [ANT-2562] (#2559)
payetvin Jan 8, 2025
ad2140f
Write raw optimization results [ANT-2302] (#2565)
flomnes Jan 9, 2025
c9cdfd1
Move .clang-format at project root (#2568)
a-zakir Jan 9, 2025
eaf0373
2.5b build linear problem from components (#2558)
flomnes Jan 10, 2025
874612d
Introduce accurate shave peaks hydro algorithm + tests (#2532)
guilpier-code Jan 10, 2025
bd4968d
Accurate shave peaks algorithm integration (#2566)
guilpier-code Jan 13, 2025
fe48071
[antares-modeler] Fix segfault when no CLI argument is provided (#2557)
flomnes Jan 13, 2025
600b914
Fix recently introduced build warnings (#2569)
flomnes Jan 15, 2025
d11f5d2
Output results : fix annual aggregation (#2580)
guilpier-code Jan 15, 2025
a64400c
Add unit test -- short-term storage cumulation constraints (#2563)
a-zakir Jan 15, 2025
7dd4dca
auto format with clang-format (#2581)
a-zakir Jan 15, 2025
7ef7977
Revert "auto format with clang-format" (#2582)
a-zakir Jan 16, 2025
475f08b
GUI bug: wrong indexes for thermal clusters in scenario builder [ANT-…
payetvin Jan 20, 2025
a5ea8f6
Remove unused enum class (#2584)
flomnes Jan 20, 2025
bcd4e1f
[ANT-2608] Introducing time dependency behaviour (#2572)
a-zakir Jan 21, 2025
28c4eda
Parallel tests run twice on ubuntu CI (#2587)
payetvin Jan 23, 2025
d13d286
Checkout test_nr to main (#2586)
payetvin Jan 23, 2025
99a50c0
Fix milp bug (#2489)
Juliette-Gerbaux Jan 23, 2025
86bff27
Remove new/delete from analyzer (#2590)
flomnes Jan 23, 2025
a5d90c3
Remove new/delete for AreaUI (#2589)
flomnes Jan 24, 2025
4a8c7ef
Rename encoders.hxx -> decoders.hxx (#2591)
flomnes Jan 24, 2025
433bac5
Remove manual allocations for set of areas, simplify code (#2588)
flomnes Jan 24, 2025
ce04ec6
Reserve out vectors to avoid copies and reallocations (#2592)
flomnes Jan 27, 2025
da7ed45
Remove a few new/delete in src/solver/variable (#2595)
flomnes Jan 27, 2025
12b4362
Bump mattnotmitt/doxygen-action from 1.9.8 to 1.12.0 (#2596)
dependabot[bot] Jan 28, 2025
4882c1f
Clean up container.h / container.hxx (#2601)
flomnes Jan 28, 2025
a464fec
Add unit tests on class `Antares::Solver::Variable::IntermediateValue…
flomnes Jan 28, 2025
65938bd
Fix segfault on BP studies (#2598)
flomnes Jan 28, 2025
e62801c
Throw exception instead of pointer to exception (#2600)
flomnes Jan 28, 2025
c5b5123
[ANT-2608] add of unit tests for time dependant expression (#2597)
a-zakir Jan 28, 2025
871ebd7
Merged with develop
sylvmara Jan 29, 2025
582e79b
Correcting merge bugs
sylvmara Jan 29, 2025
996b1d9
Corrected test constraint builder
sylvmara Jan 29, 2025
856d8bb
9.2 rc 9 (#2607)
payetvin Jan 29, 2025
caa5406
Remove recently introduced build warnings (#2602)
flomnes Jan 30, 2025
ed5e579
Derive ElemAlreadyExists from std::runtime_error (#2614)
flomnes Jan 30, 2025
3170d29
Simplify ComponentFiller::addVariables (#2615)
flomnes Jan 31, 2025
4665966
Update Contributing.md with log conventions (#2604)
pet-mit Feb 3, 2025
da91ade
Data for modeler (epic 4.1) (#2577)
guilpier-code Feb 3, 2025
3bd0409
Added paramameter in generaldata.ini : [compatibility] rampes = enabled
sylvmara Feb 3, 2025
389de9c
Unit test for the RHS of cumulative constraints (#2603)
a-zakir Feb 3, 2025
442d006
Corrected test constraint builder
sylvmara Feb 3, 2025
d3a277c
emoved unused variables for counting the constrainsts
sylvmara Feb 3, 2025
8b9df3e
Removed error in the outputs
sylvmara Feb 4, 2025
a1b7826
Add modeler non-regression tests (#2617)
pet-mit Feb 4, 2025
e51995b
Merge branch 'develop' into feature/ramping_model_scalian
sylvmara Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [ created ]
push:
branches:
- feature/ramping_model_scalian
- develop
- dependabot/*
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
git apply ../docs/antares-simulator-doxygen.patch

- name: Doxygen
uses: mattnotmitt/doxygen-action@v1.9.8
uses: mattnotmitt/doxygen-action@v1.12.0
with:
doxyfile-path: docs/Doxyfile

Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,6 @@ jobs:
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: ${{ env.SIMTEST }}
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
Expand Down Expand Up @@ -256,7 +247,7 @@ jobs:
- name: Run cucumber on short-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/short_tests.feature"
feature: "features/solver-features/short_tests.feature"

- name: Run mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
Expand Down Expand Up @@ -295,7 +286,7 @@ jobs:
- name: Run cucumber on medium-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/medium_tests.feature"
feature: "features/solver-features/medium_tests.feature"

- name: Run long-tests-1
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
Expand All @@ -321,6 +312,11 @@ jobs:
batch-name: long-tests-3
os: ${{ env.os }}

- name: Run cucumber on modeler
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/modeler-features"

- name: Barrier
if: ${{ !success() }}
run: exit 1
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
- name: Run cucumber on short-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/short_tests.feature"
feature: "features/solver-features/short_tests.feature"

- name: Run mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
- name: Run cucumber on medium-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/medium_tests.feature"
feature: "features/solver-features/medium_tests.feature"

- name: Run long-tests-1
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
Expand All @@ -313,6 +313,11 @@ jobs:
batch-name: long-tests-3
os: ${{ env.os }}

- name: Run cucumber on modeler
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/modeler-features"

- name: Barrier
if: ${{ !success() }}
run: exit 1
Expand Down
10 changes: 5 additions & 5 deletions docs/developer-guide/6-Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ v = w * (x + z);
## Logging functions:

- Use `Antares::logs.[level]() << message` for logging, below is more detailed description for level:
- `logs.info() << msg` - always prints log message
- `logs.debug() << msg` - logs only in DEBUG
- `logs.warning() << msg` - the same as `logs.info()` but catches your attention
- `logs.error()` - the same as `logs.warning()`, but triggers an error when loading a study, with exceptions
- `logs.fatal()` - same as `logs.error()`
- `logs.fatal()`: indicates an error that causes a sudden shutdown of the application (e.g. null pointer exception, stack overflow, etc.). **Must not be used in antares-simulator** (use `error()` instead)
- `logs.error()`: indicates an error that causes unexpected processing behavior or interruption. Use it for anything that causes the simulation to stop (missing or malformed data, optimization error, etc.)
- `logs.warning() << msg`: indicates undesired behavior that is not an error, and that does not interrupt processing or the application. Use if for issues that do not interrupt simulation (obsolete parameter ignored, input data ignored, etc.).
- `logs.info() << msg`: information message explaining how the simulator works, intended for the person or application using it
- `logs.debug() << msg`: information message to facilitate debugging, intended for developers
12 changes: 12 additions & 0 deletions docs/user-guide/solver/static-modeler/04-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,18 @@ _**This section is under construction**_

> _**Note:**_ You can find more information on this parameter [here](../03-appendix.md#details-on-the-include-exportmps-parameter).

---
#### include-export-solutions
- **Expected value:** `true` or `false`
- **Required:** no
- **Default value:** `false`
- **Usage:** set to `true` to activate writing the raw optimization results, that is
- For each variable, optimal values (saved in output/output-name/optimal-values-y-w--optim-nb-z.txt) and reduced costs (saved in output/output-name/reduced-costs-y-w--optim-nb-z.txt)
- each constraint, the marginal cost is saved in output/output-name/marinal-costs-y-w--optim-nb-z.txt
where y is the year number (starting from 1), w is the week number (starting from 1) and z is the optimization index (1 or 2).

This is an advanced option intended to help developers and advanced users better understand their simulation results.

---
#### include-split-exported-mps
[//]: # (TODO: document this parameter, seems to belong to another category)
Expand Down
2 changes: 1 addition & 1 deletion simtest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v9.2.0h"
"version": "v9.2.0i"
}
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(ANTARES_VERSION_REVISION 0)

# Beta release
set(ANTARES_BETA 0)
set(ANTARES_RC 8)
set(ANTARES_RC 9)

set(ANTARES_VERSION_YEAR 2024)

Expand Down
9 changes: 2 additions & 7 deletions src/analyzer/atsp/atsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ ATSP::ATSP():

ATSP::~ATSP()
{
for (uint i = 0; i != pArea.size(); ++i)
{
delete pArea[i];
}

if (pAutoClean)
{
logs.info() << "Cleaning...";
Expand Down Expand Up @@ -116,7 +111,7 @@ void ATSP::printSummary() const

for (uint i = 0; i != pArea.size(); ++i)
{
const AreaInfo& info = *pArea[i];
const AreaInfo& info = pArea[i];
if (info.rawData)
{
logs.info() << " " << info.name << ": law '"
Expand Down Expand Up @@ -163,7 +158,7 @@ bool ATSP::writeMoments() const

for (uint i = 0; i < pArea.size(); ++i)
{
const AreaInfo& info = *(pArea[i]);
const AreaInfo& info = pArea[i];
if (!info.enabled)
{
continue;
Expand Down
5 changes: 2 additions & 3 deletions src/analyzer/atsp/atsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ATSP final
{
public:
//! Vector
using Vector = std::vector<AreaInfo*>;
using Vector = std::vector<AreaInfo>;

public:
bool enabled;
Expand Down Expand Up @@ -200,7 +200,6 @@ class ATSP final
bool writeMoments() const;

void cacheCreate();
void cacheDestroy();
void cacheClear();
bool cacheFetch(uint index, Matrix<>& out) const;

Expand Down Expand Up @@ -289,7 +288,7 @@ class ATSP final
uint64_t pLimitMemory;
uint64_t pCacheMemoryUsed;
uint pCacheLastValidIndex;
Matrix<>* pCacheMatrix;
std::vector<Matrix<>> pCacheMatrix;

Yuni::String::Vector folderPerArea;
//! Temporary string mainly used for filename manipulation
Expand Down
8 changes: 1 addition & 7 deletions src/analyzer/atsp/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,11 @@ namespace Antares
{
void ATSP::cacheCreate()
{
pCacheMatrix = new Matrix<>[pArea.size()];
pCacheMatrix.resize(pArea.size());
pCacheMemoryUsed = sizeof(Matrix<>) * pArea.size();
pCacheLastValidIndex = 0;
}

void ATSP::cacheDestroy()
{
delete[] pCacheMatrix;
pCacheMatrix = nullptr;
}

void ATSP::cacheClear()
{
for (uint i = 0; i != pCacheLastValidIndex; ++i)
Expand Down
19 changes: 7 additions & 12 deletions src/analyzer/atsp/correlations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ bool ATSP::computeMonthlyCorrelations()

// Initialize mapping, to skip areas which has been disabled
// the real number of items is `realAreaCount`
uint* mapping = new uint[pArea.size()];
std::vector<uint> mapping(pArea.size());
{
uint z = 0;
for (uint i = 0; i != pArea.size(); ++i)
{
mapping[i] = (uint)-1;
if (pArea[i]->enabled)
if (pArea[i].enabled)
{
mapping[z] = i;
++z;
Expand Down Expand Up @@ -168,8 +168,8 @@ bool ATSP::computeMonthlyCorrelations()

logs.info() << "Correlation: month: " << Antares::Date::MonthToString(m)
<< ", area " << (1 + iZ) << '/' << realAreaCount << ": "
<< pArea[i]->name << " with area " << (1 + jZ) << '/' << realAreaCount
<< ": " << pArea[j]->name;
<< pArea[i].name << " with area " << (1 + jZ) << '/' << realAreaCount
<< ": " << pArea[j].name;

if (!cacheFetch(j, SERIE_P))
{
Expand Down Expand Up @@ -442,7 +442,6 @@ bool ATSP::computeMonthlyCorrelations()
moments_centr_net.clear();
moments_centr_raw.clear();
hidden_hours.clear();
cacheDestroy();

// Rounding annual correlation coefficients -zero excluded
for (uint i = 1; i < CORR_YNP.width; ++i)
Expand Down Expand Up @@ -614,7 +613,7 @@ bool ATSP::computeMonthlyCorrelations()
if (!Utils::isZero(col[jZ]))
{
const uint j = mapping[jZ];
f << pArea[i]->name << '%' << pArea[j]->name << " = " << col[jZ] << '\n';
f << pArea[i].name << '%' << pArea[j].name << " = " << col[jZ] << '\n';
}
}
}
Expand Down Expand Up @@ -650,8 +649,7 @@ bool ATSP::computeMonthlyCorrelations()
if (!Utils::isZero(col[jZ]))
{
const uint j = mapping[jZ];
f << pArea[i]->name << '%' << pArea[j]->name << " = " << col[jZ]
<< '\n';
f << pArea[i].name << '%' << pArea[j].name << " = " << col[jZ] << '\n';
}
}
}
Expand All @@ -669,7 +667,7 @@ bool ATSP::computeMonthlyCorrelations()
for (uint iZ = 0; iZ != realAreaCount; ++iZ)
{
const uint i = mapping[iZ];
f << pArea[i]->name << '\n';
f << pArea[i].name << '\n';
}
}
else
Expand All @@ -678,9 +676,6 @@ bool ATSP::computeMonthlyCorrelations()
}
}

// removing the mapping list
delete[] mapping;

return true;
}

Expand Down
22 changes: 11 additions & 11 deletions src/analyzer/atsp/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ bool ATSP::loadFromINIFile(const String& filename)
}
else
{
AreaInfo* info = new AreaInfo();
info->name = section->name;
info->name.toLower();
info->enabled = true;
info->distribution = Data::XCast::dtBeta;
AreaInfo info;
info.name = section->name;
info.name.toLower();
info.enabled = true;
info.distribution = Data::XCast::dtBeta;

IniFile::Property* p = section->firstProperty;
for (; p; p = p->next)
Expand All @@ -187,30 +187,30 @@ bool ATSP::loadFromINIFile(const String& filename)

if (key == "file")
{
info->filename = p->value;
info.filename = p->value;
continue;
}
if (key == "data")
{
key = p->value;
key.toLower();
info->rawData = (key == "raw");
info.rawData = (key == "raw");
continue;
}
if (key == "distribution")
{
info->distribution = Data::XCast::StringToDistribution(p->value);
if (info->distribution == Data::XCast::dtNone)
info.distribution = Data::XCast::StringToDistribution(p->value);
if (info.distribution == Data::XCast::dtNone)
{
logs.error() << "invalid distribution for " << section->name
<< " ('beta' will be used)";
info->distribution = Data::XCast::dtBeta;
info.distribution = Data::XCast::dtBeta;
}
continue;
}
}

pArea.push_back(info);
pArea.push_back(std::move(info));
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/analyzer/atsp/preflight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bool ATSP::preflight()
for (uint i = 0; i != pArea.size(); ++i)
{
String& folder = folderPerArea[i];
folder.clear() << pTemp << SEP << tsName << SEP << (i / 256) << SEP << pArea[i]->name;
folder.clear() << pTemp << SEP << tsName << SEP << (i / 256) << SEP << pArea[i].name;
if (!IO::Directory::Create(folder))
{
logs.error() << "impossible to create the directory " << folder;
Expand All @@ -67,8 +67,8 @@ bool ATSP::preflight()
{
if (!preflight(i))
{
pArea[i]->enabled = false;
logs.info() << " The area '" << pArea[i]->name << "' has been removed";
pArea[i].enabled = false;
logs.info() << " The area '" << pArea[i].name << "' has been removed";
}
else
{
Expand Down Expand Up @@ -102,7 +102,7 @@ bool ATSP::preflight()
bool ATSP::preflight(const uint areaIndex)
{
// Alias to the current area info
const AreaInfo& info = *(pArea[areaIndex]);
const AreaInfo& info = pArea[areaIndex];
// The folder for the current area
const String& folder = folderPerArea[areaIndex];

Expand Down
2 changes: 1 addition & 1 deletion src/format-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ fi
if ! [ -x "$(command -v clang-format)" ]; then
echo 'Warning: clang-format is not installed. Skipping' >&2
else
echo "$SOURCE_FILES" | xargs clang-format -i --verbose
echo "$SOURCE_FILES" | xargs clang-format -style=file:../.clang-format -i --verbose
fi
5 changes: 1 addition & 4 deletions src/libs/antares/study/area/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void Area::internalInitialize()
// Make sure we have
if (JIT::usedFromGUI)
{
ui = new AreaUI();
ui = std::make_unique<AreaUI>();
}
}

Expand Down Expand Up @@ -76,9 +76,6 @@ Area::~Area()

reserves.clear();
miscGen.clear();

delete ui;
ui = nullptr;
}

void Area::clearAllLinks()
Expand Down
Loading