Closed leonlan closed 1 week ago
I think I worked around this a few years ago in SimulatedAnnealing
(but might've been somewhere else). Back then the generator interface was quite new, so I hadn't wanted to move over yet. By now I think we can just port.
I initially thought of supporting both RandomState and Generator like this, but since RandomState is legacy we should just replace it entirely.
Is your feature request related to a problem? Please describe
The ALNS library currently uses
numpy.random
'sRandomState
for random number generation. But this object is considered legacy and no longer receives updates from Numpy 1.16 onwards.The main problem happens when users pass their own
rng
to ALNS. The current default RNG from numpy isGenerator
, but it has a different interface thanRandomState
(e.g.,integers
vs.randint
). Since we implement some acceptance criteria/operator selection schemes assuming that the RNG is aRandomState
object, users that useGenerator
object will run into problems.Describe the solution you'd like
We should replace
RandomState
withGenerator
.Describe alternatives you have considered
N/A
Additional context
N/A