aims-umich / neorl

NeuroEvolution Optimization with Reinforcement Learning
MIT License
51 stars 18 forks source link

Bug with setting seed to 0 #12

Closed deanrp2 closed 3 years ago

deanrp2 commented 3 years ago

In at least WOA, the seed is being set with:

if seed:  
    random.seed(seed) 
    np.random.seed(seed)

if the user chooses the seed to be 0, no seed will be set. I feel that this is unexpected behavior.

deanrp2 commented 3 years ago

One (of the many) ways this can be fixed by a careful search and replace to:

if not (seed is None):
    random.seed(seed) 
    np.random.seed(seed)
deanrp2 commented 3 years ago

I can address this, if you'd like me to, can you try assigning it to me? I think you should be able to assign issues to any github users.

mradaideh commented 3 years ago

@deanrp2 Thank you, that's actually a good catch, as it seems if statement will skip zero. I fixed that and it should show up in the next push after I made some adjustments to other classes to return latest population to test all in one go.