Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Train agent with dynamic obstacles

Discussion in 'ML-Agents' started by ybuyuk, May 24, 2022.

  1. ybuyuk

    ybuyuk

    Joined:
    Jan 4, 2022
    Posts:
    3
    Hi,

    For my project I generate collision-free paths for 2 agents from a central planner. The objective is for my agents to learn to go down their routes without colliding. The goal of the project is for the agents to learn to adjust their movement/speed/rotation etc whilst following their routes and avoiding collisions.

    I've tried many different things but I keep circling around.

    How do I train my agents so they treat the others as their dynamic obstacles? All agents should share the same behaviour as I want to copy/paste the behaviour in more agents later to be able to scale.

    Thanks!
     
  2. JcsilvaPT999

    JcsilvaPT999

    Joined:
    Apr 8, 2020
    Posts:
    2
    Hey, I'm new with MLAgents but can't you check the distance between them, and depending on that if the agents are close you start penalizing them?
     
    ybuyuk and iffalseelsetrue like this.
  3. iffalseelsetrue

    iffalseelsetrue

    Joined:
    May 3, 2018
    Posts:
    11
    I have a feeling that this is one of the collaboration scenarios, maybe check out the PUSHBLOCKCOLLAB example.
    ml-agents/Project/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlockCollab.unity

    because the agents need to work together to achieve something, if you setup the model like this example using POCA, you can loop through all agents to check their distance to each other, and when it's too close, you penalize them like what JcsilvaPT999 is suggesting.
     
    ybuyuk likes this.