-
Notifications
You must be signed in to change notification settings - Fork 25
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
[ANT-2749] Support time dependency #2622
base: develop
Are you sure you want to change the base?
Conversation
…ary but not in system
catch (const std::exception& ex) | ||
{ | ||
throw EvalVisitorDivisionException(lhs, rhs, ex.what()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The try..catch adds nothing, better to remove it for clarity
Also, I'd compare rhs to zero instead of this, but I may be wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Florian, I would compare rhs
to zero with respect to a given tolerance (e.g. 1e-16) to avoid numerical issues with float equality comparisons. But it seems you have already tried it in the commented part, so there is a maybe a good reason for this ? Probably you can handle more cases like dividing a very large number with a very small one ?
This kind of equality comparison between floats and 0, 1 or other interesting value may be often used (e.g. for online simplification of expressions later on, avoiding having unecessarily large trees : 1 * x -> x), so it can be interesting to have somewhere a function that performs float equality comparison given a numerical tolerance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update -> d7f4d21
src/expressions/include/antares/expressions/visitors/EvalVisitor.h
Outdated
Show resolved
Hide resolved
src/expressions/include/antares/expressions/visitors/EvalVisitor.h
Outdated
Show resolved
Hide resolved
params.emplace_back( | ||
context_.getParameterValue(context_.getSystemParameterValue(node->value()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API for context_
is a bit messy
...imisation/linear-problem-api/include/antares/optimisation/linear-problem-api/linearProblem.h
Outdated
Show resolved
Hide resolved
std::map<unsigned int, LinearExpression> result; | ||
for (size_t i = 0; i < linear_expressions.size(); ++i) | ||
{ | ||
result[i] = linear_expressions.at(i) - other_linear_expressions.at(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When adding or subtracting linear expression, we may end up with variables having coefficient zero (as they are not deleted from the map), does this lead to errors when adding such variables in the solver ? My insight is that it could...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well i don't know
|
||
namespace Antares::Optimisation::LinearProblemApi | ||
{ | ||
|
||
struct DataSeriesKeys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of this struct ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was using it to "transport" scenario and scenarioGroup from main to where they were supposed to be used.
Since scenario is not managed in this pr, i will have to update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TimeDependentLinearExpression
is not tested
|
|
No description provided.