Farama-Foundation / D4RL

A collection of reference environments for offline reinforcement learning
Apache License 2.0
1.35k stars 285 forks source link

Issue with a BFS search in maze environment #201

Open dgumenyuk opened 1 year ago

dgumenyuk commented 1 year ago

Proposal

Add the following lines to the _mazeenv.py: if not(next_rowcol in next_visit): next_visit.append(next_rowcol) This should be added to the lines 338 and 339 respectively.

Motivation

In my experiments on larger maps (40x40 rows and columns) sometimes the BFS search starts adding the same nodes to the _tovisit list. The to visit list grows to large, containing billions of elements.

Pitch

I suggest a simple fix to check if the element already exists in the _tovisit list before adding it to the list.

Additional context

list_too_big e](https://github.com/Farama-Foundation/d4rl/issues) in the repo (required) repetitive_entires