Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

State Space Constrains/Bounds?

Discussion in 'ML-Agents' started by leo2r, Jun 15, 2022.

  1. leo2r


    Mar 14, 2022

    I'm developing an environment where the agent moves objects around. Is there a way to set constraints on the state space? Eg. set a minimum and maximum local position the agent can take? I'm asking because I don't want the agent to just move the object to the left for infinity for example. So far I've placed walls to delimit the area and use a collider to reset the episode, but this seems a bit silly and is also affecting my camera sensors as the walls are in some of their field of view. I've scoured the documentation and forums but haven't found anything of the sort but I'd be surprised if it hasn't come up before?

    Thanks in advance :)
  2. Zibelas


    Aug 1, 2017
    You could just add a negative reward if the agent moves too far away from it to prevent it going too much.
    Invisible walls would solve at least the camera problem.
    And as for the move infinite to the left moving, that is way usually each step should have a cost and a max step amount.