Skip to content

Commit 8af2dd8

Browse files
committed
fix a zero vector bug
1 parent 7833cc9 commit 8af2dd8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

exts/siborg.simulate.crowd/siborg/simulate/crowd/socialforces.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33
from scipy.spatial import distance
44

5-
zero_vec = np.array([0,0,0], dtype='float64')
5+
# zero_vec = np.array([0,0,0], dtype='float64')
66

77
@dataclass
88
class Parameters:
@@ -19,17 +19,17 @@ class Parameters:
1919
def calc_wall_force():
2020
# TODO add wall and geometry recognition
2121

22-
force = zero_vec
22+
force = np.array([0,0,0], dtype='float64')
2323
return force
2424

2525
def calc_agent_force(rr_i, ri, vv_i, pn_rr, pn_vv, pn_r):
2626
# Sum the forces of neighboring agents
27-
force = zero_vec
27+
force = np.array([0,0,0], dtype='float64')
2828

2929
# Set the total force of the other agents to zero
30-
ff_ij = zero_vec
30+
ff_ij = np.array([0,0,0], dtype='float64')
3131

32-
rr_j =zero_vec
32+
rr_j =np.array([0,0,0], dtype='float64')
3333

3434
# Iterate through the neighbors and sum (f_ij)
3535
for j, rr_j in enumerate(pn_rr):

0 commit comments

Comments
 (0)