Kite - Detailed Router


Public Member Functions | List of all members
RoutingEventLoop Class Reference

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)
 

Detailed Description

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:

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.

Constructor & Destructor Documentation

RoutingEventLoop ( size_t  depth = 10,
int  countLimit = 20 
)

Construct a loop detector that handle depth differents segments and has a looping threshold of countLimit.

Member Function Documentation

bool isLooping ( ) const
inline

Returns: true if the loop threshold has been reached for at least one element.

Referenced by RoutingEvent::process().

int getMaxCount ( ) const
inline

The maximal count an element as reached so far.

Referenced by RoutingEvent::process().

const std::vector< Element > & getElements ( ) const
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().


The documentation for this class was generated from the following files:


Generated by doxygen 1.8.5 on Mon Oct 1 2018 Return to top of page
Kite - Detailed Router Copyright © 2008-2016 UPMC. All rights reserved