Adding a rank attribute to the Counter class and update initialization of our counters
This commit is contained in:
@@ -7,6 +7,7 @@ from typing import ClassVar
|
||||
|
||||
@dataclass
|
||||
class Counter():
|
||||
rank: int
|
||||
top: int
|
||||
value: int
|
||||
|
||||
@@ -92,11 +93,13 @@ class Minter(Persistent):
|
||||
maxcounters = 293
|
||||
self.percounter = int(self.oatop / maxcounters + 1)
|
||||
t = self.oatop
|
||||
n = 0
|
||||
while t > 0:
|
||||
top = self.percounter if t >= self.percounter else t
|
||||
c = Counter(top=top, value=0)
|
||||
c = Counter(top=top, value=0, rank=n)
|
||||
self.active_counters.append(c)
|
||||
t -= self.percounter
|
||||
n += 1
|
||||
|
||||
def _n2xdig(self, num) -> str:
|
||||
# 1. Initialize s to ''
|
||||
|
||||
Reference in New Issue
Block a user