geek-ai / MAgent

A Platform for Many-Agent Reinforcement Learning
MIT License
1.68k stars 332 forks source link

How do MAgent handle collision? #38

Open jiangwei221 opened 5 years ago

jiangwei221 commented 5 years ago

Hi geek-ai:

Thank you for contributing this great work! I want know how MAgent handle collision? Could you provide some information about the mechanism of avoiding collision or handling the collision when it happens?

Thank you for your time!

merrymercy commented 5 years ago

In the grid world, one grid can hold only one agent. When two agents want to move into a same grid, the agent with smaller ID move first. So it can occupy that grid.

You can also add randomness here (uncomment the line below). Related code: https://github.com/geek-ai/MAgent/blob/872680a8b9fee02c527306e65c4aeee1641b11a5/src/gridworld/GridWorld.cc#L573-L584

laker-sprus commented 5 years ago

Thank you for the nice work. I have two questions. 1.Many demo use "Event reward" to define the reward rule, such as gw.Event(arm1_1, 'attack', arm0_1). I am wandering where to add other Events(beside "kill" or "attack") for rewards? 2.How can I give different reward values to different agents in a same group without using the "Event reward"? Hope your reply, thanks a lot.

merrymercy commented 5 years ago

You can always hack into the system and add your own reward. The hack can be added in either python training loop or c++ game engine.

laker-sprus commented 5 years ago

Thank you very much.