Skip to content

Commit 4d342c3

Browse files
Movement takes mass and accel into account
1 parent ef3bba6 commit 4d342c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

multiagent/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def apply_action_force(self, p_force):
207207
for i,agent in enumerate(self.agents):
208208
if agent.movable:
209209
noise = np.random.randn(*agent.action.u.shape) * agent.u_noise if agent.u_noise else 0.0
210-
p_force[i] = agent.action.u + noise
210+
p_force[i] = (agent.mass * agent.accel if agent.accel is not None else agent.mass) * agent.action.u + noise
211211
return p_force
212212

213213
# gather physical forces acting on entities

0 commit comments

Comments
 (0)