(N, n_iter)
| 45 | return sep < sum_r |
| 46 | |
| 47 | def run_sim(N, n_iter): |
| 48 | box_x, box_y = 10., 6. |
| 49 | r_min, r_max = 0.1, 0.3 |
| 50 | print(f'n balls={N}') |
| 51 | for i in range(n_iter): |
| 52 | x = r_max + (box_x-2*r_max)*rand(N) |
| 53 | y = r_max + (box_y-2*r_max)*rand(N) |
| 54 | R = 0.1 + 0.8*rand(N) |
| 55 | T_s = time.time() |
| 56 | coll = collision_matrix(x, y, R) |
| 57 | n_coll = (np.sum(coll) - N)//2 |
| 58 | print(f'n coll={n_coll} Hz = ' |
| 59 | f'{1/(time.time()-T_s):.2f}') |
nothing calls this directly
no test coverage detected