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

New "cash-flow" variable for ST storage #1633

Merged
merged 11 commits into from
Sep 22, 2023
Merged

Conversation

payetvin
Copy link
Contributor

close #1624

@payetvin payetvin marked this pull request as ready for review September 20, 2023 08:21
enum
{
//! How many items have we got
count = 1 + NextT::count,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const instead of anonymous enum?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use constexpr instead


inline uint64_t memoryUsage() const
{
uint64_t r = (sizeof(IntermediateValues) * nbClusters_ + IntermediateValues::MemoryUsage())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what r is for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a temporary variable that's used to compute the memory usage.

Copy link
Member

@flomnes flomnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. A few small improvements are listed below.

src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
@guilpier-code
Copy link
Contributor

From #1624, we have :
CashFlow[h] = (soutirage - injection) * MRG. PRICE

Meaning that, if we do only injection (into the network), we have a negative value.
Is this what we want ?

@guilpier-code
Copy link
Contributor

guilpier-code commented Sep 20, 2023

I made some tests on Antares_Simulator_Tests_NR/valid-v860/tests-ST-storage.
In this study's generaldata.ini, we should add :

[variables selection]
...
select_var + = STS CASHFLOW BY PLANT
...

@guilpier-code
Copy link
Contributor

From #1624, we have : CashFlow[h] = (soutirage - injection) * MRG. PRICE

Meaning that, if we do only injection (into the network), we have a negative value. Is this what we want ?

About injection and withdrawal, we always adopt the storage point of view. Injection means injection into the storage.
So if we have only injection, it means that the storage has to pay something for incomes. The benefit is < 0, logically.

enum
{
//! How many items have we got
count = 1 + NextT::count,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use constexpr instead

src/solver/variable/economy/STStorageCashFlowByCluster.h Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 28 Code Smells

0.0% 0.0% Coverage
48.5% 48.5% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint


inline uint64_t memoryUsage() const
{
uint64_t r = (sizeof(IntermediateValues) * nbClusters_ + IntermediateValues::MemoryUsage())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a temporary variable that's used to compute the memory usage.

@payetvin payetvin merged commit 57f1ae0 into develop Sep 22, 2023
6 of 7 checks passed
@payetvin payetvin deleted the feature/cashflow-sts branch September 22, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New "cash-flow" variable for ST storage
4 participants