Farama-Foundation / HighwayEnv

A minimalist environment for decision-making in autonomous driving

Home Page:https://highway-env.farama.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Randint problem when loading racetrack environment

Agathe48 opened this issue · comments

I notice there was sometimes a bug when loading the racetrack environment, the following error was shown:
File highway_env\road\road.py", line 254, in random_lane_index
_id = np_random.randint(len(self.graph[_from][_to]))
AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'

I managed to fix it in my local environment by changing this line in the file: highway_env\road\road.py", line 254, in random_lane_index
I change the line _id = np_random.randint(len(self.graph[_from][_to])) to _id = np_random.integers(len(self.graph[_from][_to])).

I don't know if it's the best way to fix this bug but it works for me.

Hi @Agathe48,
Sorry about this, this has been fixed already in

b0a4a84

(and yes you suggested the correct fix)

But it hasn't made it into a release yet, I guess I should probably make a hot fix