The question about the correct way of using requestdecision() function.

I’m training a agent to use its hand to touch a ball launched randomly from a fixed position, but what I found in my training result is that agent is always making a action before the ball get close, which also influenced the rewards to agent, mean reward is very low, about 1, and mean reward didn’t change a lot as training. So I don’t want agent to make actions every step(or every frame of fixedupdate), so I just want it to make a action when the ball is very close, thus the agent can precisely make a action to touch the ball.

I read the document, but still puzzled. I don’t know how to use requestdesion() correctly in my code so that my agent can precisely make a action to touch the ball when the ball is very close. Or you would share another methods that can figure out my problem.

Thank you for your response!

Hi!

If you want to control the rate at which the agent makes decisions, you can add a decision requestor component to your agent and set it’s decision period: ml-agents/docs/Learning-Environment-Design-Agents.md at release_18_docs · Unity-Technologies/ml-agents · GitHub Checkout the sample environments Unity project in the ML-Agents repo for insight in how to set this up: ml-agents/Project at main · Unity-Technologies/ml-agents · GitHub

Thank you for your response! I tried to use decision requestor and set its period, but after trainging, I found that agent perform the action of lefthand frequently, and it was still too frequent even though I set the period as maximum 20, agent always performs the action before the ball get close, which I think the agent don’t need to make a unnecessary action before the ball get very close. How could I limit the agent’s frequent actions?

As for RequestDecision(), I found that when calling RequestDecision() one time, the agent perform action one time. Is this would be helpful to limit the agent’s frequent actions? Or After I use decision requestor to finish the training, could I set RequestDecision() in my code to control the timing of touching the ball?
I want to know if my idea is right. The result didn’t look very good even though I followed my idea to try again.