Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted Adding a Delay to actions taken by the ML Agent and assigning a reward after output

Discussion in 'ML-Agents' started by rohan1992, Jul 29, 2020.

  1. rohan1992


    Oct 21, 2017
    I am making an ML agent that modifies different noise and height parameters on a generated terrain mesh.

    Is there some way for me to:
    1) Tell the agent to make a change to the parameters of the noise (I am doing this with OnActionReceived)
    2) Wait till the terrain chunks have been generated to collect observations on the generated terrain(About 2 seconds till the terrain is generated)
    3) AFTER the generation is completed(2-3 second delay), assign a reward based on the calculated parameters of the terrain and end the episode
    4) Start a new episode and reset the generator to random noise, make the agent take a new action and generate terrain

    I am quite stuck on 2 and 3. I was thinking of delaying the generator taking an action using the DecisionRequester but I am quite stuck as to how I can make the agent wait for the generation to complete and then add a reward.

    Is there some way for me to make it a decision every 5 seconds and then collect observations/assign rewards after the terrain is generated?
  2. celion_unity


    Unity Technologies

    Jun 12, 2019
    There's nothing built-in for this. I would recommend not using a DecisionRequester, and just calling Agent.RequestDecision() on your on schedule.