For context, I am making a multi-agent collision avoidance environment and I created a Vector Observation Space size of 2
-
The relative angle of the agent to it’s desired goal (0 when on direct path, ranges between -180 to 180 degrees)
-
Distance between Agent and Goal
Upon agent collision with a wall or another agent (Ray Perception 3D) they deactivate so naturally there becomes fewer observations made than the determined vector size.
Is it possible to disable the Vector Observation Space of agents right before they are disabled the environment?
In the case it is possible, are either of these two ideas on the right track? -
If statement within the CollectObservations function to only AddObservation when Agent.gameObject.SetActive(True) :
if (gameObject.activeInHierarchy == true)
{
sensor.AddObservation(relAngle);
sensor.AddObservation(relDistance);
}
- Initialize a boolean (isGone) to False. OnEpisodeBegin still equal false. And, since the Agent script calls functions from my environment script when it collides with something (which Turns off the agent), I make the boolean true. Like this:
void OnCollisionEnter(Collision col)
{
if (col.transform.CompareTag(“agent”))
{
isGone = true;
m_EnvController.CrashedIntoAgent(this);
}
}