@@ -65,7 +65,7 @@ class BaseMRG( BaseRandom ):
6565 print( rand(a) ) # prints a pseudo-random value within [0.0, a)
6666 print( rand(a,b) ) # prints a pseudo-random value within [a , b)
6767
68- Inheriting classes have to define class attributes '_LIST_SIZE ' and '_MODULO'. See
68+ Inheriting classes have to define class attributes '_STATE_SIZE ' and '_MODULO'. See
6969 MRGRand287 for an example.
7070
7171 Reminder:
@@ -93,10 +93,10 @@ def __init__(self, _seedState: SeedStateType = None) -> None:
9393
9494 _seedState is either a valid state, an integer, a float or None.
9595 About valid state: this is a tuple containing a list of
96- self._LIST_SIZE integers and an index in this list (index value
97- being then in range(0,self._LIST_SIZE )). Should _seedState be
96+ self._STATE_SIZE integers and an index in this list (index value
97+ being then in range(0,self._STATE_SIZE )). Should _seedState be
9898 a sole integer or float then it is used as initial seed for
99- the random filling of the internal list of self._LIST_SIZE
99+ the random filling of the internal list of self._STATE_SIZE
100100 integers. Should _seedState be anything else (e.g. None) then
101101 the shuffling of the local current time value is used as such an
102102 initial seed.
@@ -123,8 +123,8 @@ def getstate(self) -> StateType:
123123 """Returns an object capturing the current internal state of the generator.
124124
125125 This object can be passed to setstate() to restore the state. It is a
126- tuple containing a list of self._LIST_SIZE integers and an
127- index in this list (index value being then in range(0,self._LIST_SIZE ).
126+ tuple containing a list of self._STATE_SIZE integers and an
127+ index in this list (index value being then in range(0,self._STATE_SIZE ).
128128 """
129129 return (self ._state [:], self ._index )
130130
@@ -137,11 +137,11 @@ def setstate(self, _seedState: StateType) -> None:
137137 getstate(), and setstate() restores the internal state of the
138138 generator to what it was at the time setstate() was called.
139139 About valid state: this is a tuple containing a list of
140- self._LIST_SIZE integers (31-bits) and an index in this list
141- (index value being then in range(0,self._LIST_SIZE )). Should
140+ self._STATE_SIZE integers (31-bits) and an index in this list
141+ (index value being then in range(0,self._STATE_SIZE )). Should
142142 _seedState be a sole integer or float then it is used as
143143 initial seed for the random filling of the internal list of
144- self._LIST_SIZE integers. Should _seedState be anything else
144+ self._STATE_SIZE integers. Should _seedState be anything else
145145 (e.g. None) then the shuffling of the local current time
146146 value is used as such an initial seed.
147147 """
@@ -170,7 +170,7 @@ def _initIndex(self, _index: int) -> None:
170170 """Inits the internal index pointing to the internal list.
171171 """
172172 try :
173- self ._index = int ( _index ) % self ._LIST_SIZE
173+ self ._index = int ( _index ) % self ._STATE_SIZE
174174 except :
175175 self ._index = 0
176176
@@ -186,7 +186,7 @@ def _initState(self, _initialSeed: StateType = None) -> None:
186186 """
187187 # feeds the list according to an initial seed and the value+1 of the modulo.
188188 myRand = FastRand32 ( _initialSeed )
189- self ._state = [ int (myRand (self ._MODULO + 1 )) for _ in range (self ._LIST_SIZE ) ]
189+ self ._state = [ int (myRand (self ._MODULO + 1 )) for _ in range (self ._STATE_SIZE ) ]
190190
191191
192192#===== end of module basemrg.py ========================================
0 commit comments