From 11f031009e87d8b3d7a0ff3f2966f5304d85be0e Mon Sep 17 00:00:00 2001 From: LeoDup <41289957+LeoDup@users.noreply.github.com> Date: Mon, 16 Jul 2018 15:27:09 +0200 Subject: [PATCH] good_agents reward correction in simple_world_comm Previously good_agents got more reward by being far from the food, i thought they should be punished for being far from the food. --- multiagent/scenarios/simple_world_comm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multiagent/scenarios/simple_world_comm.py b/multiagent/scenarios/simple_world_comm.py index 499456e40..6aa388e73 100644 --- a/multiagent/scenarios/simple_world_comm.py +++ b/multiagent/scenarios/simple_world_comm.py @@ -178,7 +178,7 @@ def bound(x): for food in world.food: if self.is_collision(agent, food): rew += 2 - rew += 0.05 * min([np.sqrt(np.sum(np.square(food.state.p_pos - agent.state.p_pos))) for food in world.food]) + rew -= 0.05 * min([np.sqrt(np.sum(np.square(food.state.p_pos - agent.state.p_pos))) for food in world.food]) return rew