Repository navigation
[BugFix] fast_any_tap boundary handling boundary handling in binary search - #1632
Jerry-Jinfeng-Guo wants to merge 3 commits into
Conversation
Signed-off-by: Jerry Jinfeng Guo <jerry.jinfeng.guo@alliander.com>
There was a problem hiding this comment.
Pure binary search runs will not trigger max iteration error.
There was a problem hiding this comment.
so what does it return if there are 2 conflicting tap changers? Does it choose either of the settings? How does it choose which one is better?
There was a problem hiding this comment.
The built-in reset mechanism will handle that and the top layer optimization logic remains the same.
There was a problem hiding this comment.
Discussion needed wrt behaviour.
There was a problem hiding this comment.
We originally talked about 2 edge cases in which the boundary handling needs an explicit choice:
u_set + u_bandtoo low for all tap positions, oru_set - u_bandtoo high for all tap positions- This is the bug talked about in [BUG]
fast_any_tapincorrectly handles voltage bands outside the achievable voltage range #1215
- This is the bug talked about in [BUG]
- small
u_band: some tap positions result in a voltage belowu_set - u_bandand some tap positions result in a voltage aboveu_band + u_band(this case)- This case is ambiguous and we indeed should discuss now whether to hard error or allow it for binary search.
- I believe that binary search setting on one or the other makes sense (I agree with your choice)
- How does this work for max and min strategies, respectively? Are these edge cases handled correctly now?
There was a problem hiding this comment.
Indeed, we should have this discussion. As for min and max strategies, they are both 'unaffected' thanks to the explore_neighbourhood we put in place for the final wiggle.
There was a problem hiding this comment.
I'm unresolving because I have a question that's likely related: The same test case for any strategy still fails with MaxIterationReached, shouldn't both behave the same in this case, or at least both have the same behaviour even if the final tap position isn't the same?
There was a problem hiding this comment.
I am in principle agreeing with your point. However, I would argue that we need to align the behavior of any strategy to that of the physical behavior. That is, if a ping-poinging behavior is detected during an any search, the search should terminate. This will eliminate the infinite loops we may have with ultra small u_band and return a tap pos that is close to said band.
In short, we should revisit the any strategy.
There was a problem hiding this comment.
Side note: std::midpoint(10, 21) == 15 and std::midpoint(21, 10) == 16, so the description is wrong. It doesn't affect the current bug-fix, but nice to address it at once.
There was a problem hiding this comment.
I'm unresolving because I have a question that's likely related: The same test case for any strategy still fails with MaxIterationReached, shouldn't both behave the same in this case, or at least both have the same behaviour even if the final tap position isn't the same?
There was a problem hiding this comment.
The name of the folder suggests that this case would reach max-iterations, right? Can we change it so we don't get confused? Same for below.
There was a problem hiding this comment.
If we do intend to revisit the any strategy to unify the behavior, I would do the renaming in that follow-up. I will put some comment in the test so that this is clear.
Signed-off-by: Jerry Jinfeng Guo <jerry.jinfeng.guo@alliander.com>
Signed-off-by: Jerry Jinfeng Guo <jerry.jinfeng.guo@alliander.com>
|



Fixes #1215
The behaviour that lead to the original bug was due to us strictly limiting binary search to search between the upper bound and lower bounds. In cases where target voltage range lives outside such bounds, boundary taps should be considered.
Some other tests are also updated. Due to the nature of including a boundary, binary search will terminate at
lower_bound == upper_boundand will not run all the way untilmax_iterreached. This will change the behaviour of the search wrt maximum iteration exceptions.Arguably, if target range falls outside the achievable range, we return the closest tap without exception, the same should apply to small
u_band.