I want to set up two behaviours for one agent. One behaviour would be a patrolling type behaviour, and the other would be a ‘something has been detected’ behaviour.
Is this possible and, if so, what would the best way of achieving this be?
I was thinking of creating and training two agents separately and then having them perform inference in a scenario, but then instantiate/destroy them at the right moment so it would look as though the same agent changed behaviours. This would allow each behaviour to have it’s own unique set of observations, but would force them to train separately.
Training two distinct agents should work for this. You could implement the physics in a separate class, so that both your agents receive observations from, and send actions to that common physics interface. Then it’s just a matter of calling RequestDecision/Action on whatever agent behaviour is applicable during inference. Some controller script would decide which agent is active or inactive depending on the situation, without having to instantiate or destroy any agents.