Hello,
I have an agent with, let’s say, 6 cameraSensorComponents, and 2 vector observations.
When I get the DecisionStep in python, I noticed that these observations are returned scrambled up: I get 4 visual observations (from DS[0] to DS[3]), then 1 observation corresponding to vector obs. (DS[4]), and then all the remaining visual observations DS[5] and DS[6]).
Why is that? Is it possible to specify an order in advance? Is the order always the same? (so that I can rearrange them in my pyhon code)?
I will answer my own question since this may be important to other people.
The observations are passed alphabetically. The vector observation should corresponds to the letter “V” (from vector, probably). Some of my camera’s Sensor Name started with the letter T, other with Z, so the observation would be split accordingly.
You’re correct that they’re sorted alphabetically by name. This is because they always need to be in the same order between training and inference, and on Agents of the same behavior name, and I couldn’t find any guarantees on the ordering for GetComponents.
The Agent’s VectorSensor that it uses for CollectObservations is named $“VectorSensor_size{observationSize}”.
Thanks for this information. I noticed a small addition: the observations are first ordered by GameObject hierarchy, and then alphabetically if two sensors are siblings in the hierarchy.