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 output var : min gen for thermal #2608

Open
wants to merge 7 commits into
base: feature/dynamic-cluster-groups
Choose a base branch
from

Conversation

guilpier-code
Copy link
Contributor

@guilpier-code guilpier-code commented Jan 30, 2025

  • Related ticket is ANT-2425.
  • A study that tests this new behavior can be found here (please have a look to its users notes).

@guilpier-code guilpier-code changed the base branch from develop to feature/dynamic-cluster-groups January 30, 2025 09:25
@guilpier-code guilpier-code marked this pull request as draft January 30, 2025 12:14
src/libs/antares/study/study.cpp Outdated Show resolved Hide resolved
Comment on lines +97 to +100
auto each_has_min_gen() const
{
return each_enabled_and_not_mustrun() | std::views::filter(&ThermalCluster::hasMinGen);
}
Copy link
Member

Choose a reason for hiding this comment

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

Probably not necessary

Copy link
Contributor Author

@guilpier-code guilpier-code Feb 5, 2025

Choose a reason for hiding this comment

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

I removed hasMinGenCount() from class ThermalClusterList.
But for this one (each_has_min_gen()), what do you suggest ?

Copy link
Member

Choose a reason for hiding this comment

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

I suggest not using this filter since it's extremely unusual for output variables to be printed based on such a condition. Print the value for every enabled cluster.

Copy link
Contributor Author

@guilpier-code guilpier-code Feb 5, 2025

Choose a reason for hiding this comment

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

cluster list is a business concept, and output variables is not.
So you mean that each_has_min_gen() unnecessarily bloats class ThermalClusterList with a function used only in output ?

If you want each_has_min_gen() to disappear from class ThermalClusterList, we could create instead a free function more in the scope of output variables (utils.h ?) that would do the job and would avoid code duplication.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should produce this variable for all enabled cluster, no matter if they have a min-gen or not

Copy link
Contributor Author

@guilpier-code guilpier-code Feb 5, 2025

Choose a reason for hiding this comment

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

I think we should produce this variable for all enabled cluster, no matter if they have a min-gen or not

it's a change of specification. To be discussed with our PO.

Comment on lines +231 to +233
pValuesForTheCurrentYear[numSpace][groupNumber][state.hourInTheYear] += std::min(
production,
minGen);
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I understand this, isn't this always the case that

production >= minGen

?

Copy link
Contributor Author

@guilpier-code guilpier-code Jan 31, 2025

Choose a reason for hiding this comment

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

  • minGen is made from only :
    • min gen modulation (which is a TS of doubles > 0.)
    • nominal capacity.
  • available capacity is a TS on its own.

If, for some hours in the week, available capacity (which is an upper bound for production) decreases under minGen, then the lower bound for production at these hours is available capacity. So, for these hours, production is exactly available capacity.

Indeed, we have (see common-eco-adq.cpp) :

Pt.PuissanceMinDuPalierThermique[hourInWeek] = 
    (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster->PthetaInf[hourInYear]) ?
        Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] : 
        cluster->PthetaInf[hourInYear];

@guilpier-code guilpier-code marked this pull request as ready for review February 3, 2025 15:46
Copy link

sonarqubecloud bot commented Feb 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
58.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@guilpier-code guilpier-code requested a review from flomnes February 5, 2025 15:21
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.

2 participants