How to feed a 2D integer array into observations?

Hi, friends!

I’m haven’t write down the codes now and come to ask the question beforehand. Hope you understand.

I’m creating a simulation which involves 5 stations and some obstacles moving around blocking them from connected. The agent’s goal is to make sure all 5 stations stay connected, in other words, there should not have station(s) is seperated. Also, a station can have at most 2 connections, so there shouldn’t have circles.


So i am thinking using a 2D 5x5 integer array: int[5,5] ConnectionMap to store the connections. 0 - available, 1 - connected, 2 - blocked. And im not using camara observation.

Here is my problem: how can I or can I send this 2D array into observations? I’m using ml-agent 19 and I don’t remember there is a way that you can send a multi-dimension array into observations, correct me if there is any.

And also, if you have any ideas on how can i optimize the solution above, that would be great of help!

a 5x5 array is the same as a single one that has 25 entries. You can as well just loop over your 5x5 array and add each entry as an observation.

1 Like