Skip to content
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

Insteon: Change Hopcount Calculation to a Moving Average #266

Merged
merged 4 commits into from
Oct 20, 2013

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Oct 7, 2013

When I created the current hopcount calculation, I opted to use the highest count over the past 20 reported figures as the hopcount. This often resulted in a higher than necessary hopcount.

@mstovenour modified that original code to use a running average. After significant testing (both real world and using the new stress test) it is clear that using a running average results in a more reliable network.

Of note, the hopcount system has always relied on the hopcounts of incoming messages to determine the proper outgoing hopcount. I have at least two devices on my network in which the hopcounts are highly asynchronous. That is, where the outgoing and incoming hopcounts are very different. If you have one of these instances, you should consider using the min_hops() and max_hops() routines for that device.

Michael Stovenour and others added 4 commits June 15, 2013 10:07
In addition to the running average implementation, this update also
provides a few slight performance optimizations.  One of the primary
advantages to this algorythm is that it does not need to loop over
then entire array for each hop count update.  Also enhanced log_aldb_status
a bit to include the device name.
Conflicts:
	lib/Insteon/BaseInsteon.pm
A moving average of the last 20 hop_counts was a bit excessive and required 10 messages before a hop count would change.
…p_Count

Moved per device setting outside of logic so that they are checked even if a hop_count is not passed.
krkeegan added a commit that referenced this pull request Oct 20, 2013
Insteon: Change Hopcount Calculation to a Moving Average
@krkeegan krkeegan merged commit ebc77b8 into hollie:master Oct 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants