Modeler > Port field definition : allow non linear expressions [ANT-4646]#3483
Modeler > Port field definition : allow non linear expressions [ANT-4646]#3483
Conversation
| @@ -87,58 +87,43 @@ static void CommonPreSolve(ForbiddenNodes& f) | |||
|
|
|||
| static ForbiddenNodes ForbiddenInConstraint() | |||
There was a problem hiding this comment.
Code about defining node prohibition in an expression (depending on use context) was simplified.
- What remains : static functions are still called once.
- What we loose : calls to these functions are eager (they are called once exactly, even if not needed). Code used to be lazy (calls were made once, and only if needed).
- What we gain : code is more readable, more simple, has less lines
…+ change node prohibition for port field definition
…es compatibility of 2 connected port fields
flomnes
left a comment
There was a problem hiding this comment.
The logic for port field role is unclear
| const ForbiddenNodes forbiddenInConstraint = ForbidNodesInConstraint(); | ||
| const ForbiddenNodes forbiddenInBindingConstraint = ForbidNodesInBindingConstraint(); | ||
| const ForbiddenNodes forbiddenInVariableBounds = ForbidNodesInVariableBounds(); | ||
| const ForbiddenNodes forbiddenInPortFieldDef = ForbidNodesInPortFieldDef(); | ||
| const ForbiddenNodes forbiddenInObjective = ForbidNodesInObjective(); | ||
| const ForbiddenNodes forbiddenInExtraOutput = ForbidNodesInExtraOutput(); |
There was a problem hiding this comment.
I'm not sure why this needs to be added
There was a problem hiding this comment.
I did that for performance reason : otherwise we would have to call the same function each time we need it.
Here the result of this call is store in a constant.
…efore allowing forbidden nodes in system conversion)
…o ForbiddenNodes.h/.cpp
…indingConstraint_ to class SystemModel::Constraint
…converting system
…lax-expr-in-port-definition # Conflicts: # src/io/inputs/model-converter/modelConverter.cpp # src/study/system-model/include/antares/study/system-model/constraint.h
flomnes
left a comment
There was a problem hiding this comment.
Lots of refactoring / renaming, can you split this PR in 2 ?
- Refactor / rename
- Implement the actual feature
Thank you
…t not yet run by cucumber.
…ng an expected exception
what do you mean by unclear ? unclear in what way ? |
Co-authored-by: guilpier-code <62292552+guilpier-code@users.noreply.github.com> Co-authored-by: guilpierre <guillaume.pierre_externe@rte-france.com> Co-authored-by: Jason Maréchal <45510813+JasonMarechal25@users.noreply.github.com> Co-authored-by: Josh <139483907+YoshuaLisasi@users.noreply.github.com>
|
This PR is too big. Please break it up into smaller PRs. |
|
…3536) This PR is about [ticket ANT-4646](https://gopro-tickets.rte-france.com/browse/ANT-4646). A first PR ([PR 3483](#3483)) was merged into **develop**. After tests by @Juliette-Gerbaux, some fixes were recommended : - relax port field definitions expressions, so that non linear operators **min**, **max**, **ceil**, **floor** can accept variable nodes (**VariableNode**). - restore prohibition of operator **sum_connections** (node **PortFieldSumNode**) in port field definitions --------- Co-authored-by: guilpierre <guillaume.pierre_externe@rte-france.com>



Fixes ticket ANT-4646
Ticket ANT-4646 is addressed (hopefully) : we relaxed the prohibition in expression of models' port-field-definitions (any non-linear operator is allowed), and we made sure that, once components and connections are read, port field resolution in binding constraint section leads to linear expressions only.
While addressing ANT-4646, what was done (more precisely) :
ForbiddenNodesVisitorwas modified to be able to make port field resolution and check linearity.