Hi,
I was wondering, if there is a reason why the counter is never reset to 0, when localTick() is being called.
In the referenced paper the counter is always set to 0, when the value for the wall clock is being updated.
See page 5, figure 5 in the paper: The else-branch sets the counter c of node j to 0. The else-branch is being reached if the physical time l has increased.
By not resetting the counter value, we increase the risk of overflowing it. Only receiving an event will reset the counter, I believe.
I think adding counter = 0 in the copy()-call below should fix it:
|
Ok(local.copy(timestamp = wallClockTime)) |
Hi,
I was wondering, if there is a reason why the counter is never reset to 0, when
localTick()is being called.In the referenced paper the counter is always set to 0, when the value for the wall clock is being updated.
See page 5, figure 5 in the paper: The else-branch sets the counter c of node j to 0. The else-branch is being reached if the physical time l has increased.
By not resetting the counter value, we increase the risk of overflowing it. Only receiving an event will reset the counter, I believe.
I think adding
counter = 0in thecopy()-call below should fix it:hlc/src/commonMain/kotlin/com/tap/hlc/HybridLogicalClock.kt
Line 43 in 33aba2a