Use ceil instead of round for relay number rounding
This commit is contained in:
parent
8c3a75b3c8
commit
5a4ae2153e
|
@ -74,7 +74,7 @@ def emptyChanAllocate(net, flist, relay, new):
|
||||||
sum_free = sum(chanfree[0].values()) # 250
|
sum_free = sum(chanfree[0].values()) # 250
|
||||||
chans_not_covered = toalloc - sum_free # 2148 - 250 = 1898
|
chans_not_covered = toalloc - sum_free # 2148 - 250 = 1898
|
||||||
relays_needed = chans_not_covered / chanfree[1] # 1898 / 250 = 7.592
|
relays_needed = chans_not_covered / chanfree[1] # 1898 / 250 = 7.592
|
||||||
relays_needed_rounded = round(relays_needed)
|
relays_needed_rounded = ceil(relays_needed)
|
||||||
debug(f"emptyChanAllocate() secondary allocation sum_free:{sum_free} chans_not_covered:{chans_not_covered} relays_needed:{relays_needed} relays_needed_rounded:{relays_needed_rounded}")
|
debug(f"emptyChanAllocate() secondary allocation sum_free:{sum_free} chans_not_covered:{chans_not_covered} relays_needed:{relays_needed} relays_needed_rounded:{relays_needed_rounded}")
|
||||||
#correction = round(toalloc - sum(chanfree[0].values()) / chanfree[1])
|
#correction = round(toalloc - sum(chanfree[0].values()) / chanfree[1])
|
||||||
correction = relays_needed_rounded
|
correction = relays_needed_rounded
|
||||||
|
|
Loading…
Reference in New Issue