Making a working observation space with numpy arrays?

How severe does this issue affect your experience of using Ray?

  • Medium: It contributes to significant difficulty to complete my task, but I can work around it.

In the past making openai gyms to use for keras I have always used numpy arrays as observation spaces, but it doesn’t seem to work for rllib because it errors: ‘numpy.ndarray’ object has no attribute ‘contains’.

How can I make a working observation for the environment below? The basic idea of this environment is the job shop problem. There is a list of orders that needs to be assigned to the machine with the lowest cross-over time between orders. Cross-over time is based on a change in commodity of the order, so the observation space should hold every item in the orders list with its commodity. The state will be the current order on the schedule (so its commodity can be compared with the new order that is chosen). How can I make that work?

Hi @gartpr,

Are you still having issues? Do you have a full reproduction script and complete stack trace of the errors you can share?

It is not possible to know what is wrong with the info you have shared.

Hi @mannyv

I have uploaded the notebook I’m using to the github link below. I’m just getting started learning RLlib and Open AI gym to see if it could be a solution to something I’m working on. The problem is related to the observation space and state (which can be seen in the notebook) which I’m just not sure how to get right. It needs to be able to hold an item id and some data about the item:
[ 89345,
LETT,
1/4 IN]
for every order on the order list.

Any help is appreciated.

https://github.com/gartpr/Production-Line—RLlib

Hi @gartpr,

One issue I see is that you are changing the observation and action spaces in reset and step. These should be set in the constructor and then not changed during the experiment. They should also be gym space objects which they are in init_ but then you change them to be numpy arrays in reset and obs. That is the cause of the error you are currently seeing.