Simple loop dectector for RoutingEvent. More...
Public Member Functions | |
RoutingEventLoop (size_t depth=10, int limit=20) | |
bool | isLooping () const |
int | getMaxCount () const |
const std::vector< Element > & | getElements () const |
void | update (size_t id) |
void | erase (size_t id) |
Simple loop dectector for RoutingEvent.
The RoutingEventLoop can be roughly understood as a truncated histogram of the depth
last (in the time meaning) greatest riped up elements.
The loop detector keep track of the depth
TrackElement with the greatest processing count. TrackElement are just identified through the id
of their associated AutoSegment. Each entry in the loop table contains:
id
of the associated TrackSegment (Katabatic::AutoSegment).count
of times it has been processedtimestamp
of the latest time it has been updated.The table (implemented as vector<>
) it kept sorted on the timestamp (decreasing). Whenever there is more than depth
elements in the table, the oldest one are discarted (regardless of their count). Obviously, there are pathological cases into which a loop cannot be detected, but so far it has not happened so a more robust approach seems not necessary at this time.
Whenever the count of an element reaches countLimit
, the looping flag is set. It will remains set unless the faulty element is manually removed.
RoutingEventLoop | ( | size_t | depth = 10 , |
int | countLimit = 20 |
||
) |
Construct a loop detector that handle depth
differents segments and has a looping threshold of countLimit
.
|
inline |
Returns: true if the loop threshold has been reached for at least one element.
Referenced by RoutingEvent::process().
|
inline |
The maximal count an element as reached so far.
Referenced by RoutingEvent::process().
|
inline |
The complete table elements.
Referenced by RoutingEvent::process().
void update | ( | size_t | id | ) |
Update the loop, telling that element id
has appreared one more time.
Referenced by RoutingEvent::process().
void erase | ( | size_t | id | ) |
Remove the entry related to element id
in the table. The state of the table is fully recomputed after the removal (looping flag & maximum count).
This method is used when a loop has been encountered, presumably on element id
, and we want to continue. To avoid the loop detector yelling at each check, the associated TrackElement should be invalidated and it's reference removed from the table.
Referenced by RoutingEvent::process().
Generated by doxygen 1.8.14 on Sun Nov 21 2021 | Return to top of page |
Kite - Detailed Router | Copyright © 2008-2020 Sorbonne Universite. All rights reserved |