Skip to content

Commit d4a7835

Browse files
committed
if more than half agents cheat, they all move backward
1 parent 7573140 commit d4a7835

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

multiagent/scenarios/race.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def agent_cheated(agent):
8888

8989
for i, thisAgent in enumerate(world.agents):
9090
if numOfCheaters > numOfAgents//2:
91-
thisAgent.action.u[1] = 0.0 # all cheat: stay
91+
thisAgent.action.u[1] = -0.1 # all cheat: move back ward
9292
elif numOfCheaters == 0:
9393
thisAgent.action.u[1] = 0.1 # all cooperate: move up together
9494
else:

0 commit comments

Comments
 (0)