this snippet of code shows that if there are 4 agents, the board will reserve some coordinates to create passages for the agents. But if the num_wood/num_rigid is set to less than 12, the code looks not right.
if num_agents == 4:
for i in range(4, size - 4):
board[1, i] = wood
board[size - i - 1, 1] = wood
board[size - 2, size - i - 1] = wood
board[size - i - 1, size - 2] = wood
coordinates.remove((1, i))
coordinates.remove((size - i - 1, 1))
coordinates.remove((size - 2, size - i - 1))
coordinates.remove((size - i - 1, size - 2))
num_wood -= 4
one way to fix:
if num_agents == 4 and num_wood > 12:
for i in range(4, size - 4):
board[1, i] = wood
board[size - i - 1, 1] = wood
board[size - 2, size - i - 1] = wood
board[size - i - 1, size - 2] = wood
coordinates.remove((1, i))
coordinates.remove((size - i - 1, 1))
coordinates.remove((size - 2, size - i - 1))
coordinates.remove((size - i - 1, size - 2))
num_wood -= 4
this snippet of code shows that if there are 4 agents, the board will reserve some coordinates to create passages for the agents. But if the num_wood/num_rigid is set to less than 12, the code looks not right.
one way to fix: