Skip to content

Commit

Permalink
Fix g calculation in fromSample
Browse files Browse the repository at this point in the history
  • Loading branch information
karknu committed Jul 1, 2020
1 parent 5138e24 commit 44ed488
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ouroboros-network/src/Ouroboros/Network/DeltaQ.hs
Expand Up @@ -292,12 +292,13 @@ defaultGSV = PeerGSV { outboundGSV, inboundGSV }

maxG :: DiffTime
maxG = microsecondsAsIntToDiffTime maxBound / 4
--maxG = 500e-3 -- not unreasonable but old default value

fromSample :: Time -> Time -> SizeInBytes -> PeerGSV
fromSample (Time start) (Time end) _size =
PeerGSV { outboundGSV, inboundGSV }
where
g = (start - end) / 2
g = (end - start) / 2

inboundGSV = ballisticGSV g 2e-6 (degenerateDistribution 0)
outboundGSV = inboundGSV
Expand Down

0 comments on commit 44ed488

Please sign in to comment.