(sidewalk, min_points, interval, cross_probability, segment_map, rng=None)
| 504 | |
| 505 | @staticmethod |
| 506 | def rand_path(sidewalk, min_points, interval, cross_probability, segment_map, rng=None): |
| 507 | if rng is None: |
| 508 | rng = random |
| 509 | |
| 510 | spawn_point = sidewalk.get_nearest_route_point(segment_map.rand_point()) |
| 511 | |
| 512 | path = SidewalkAgentPath([spawn_point], [rng.choice([True, False])], min_points, interval) |
| 513 | path.resize(sidewalk, cross_probability) |
| 514 | return path |
| 515 | |
| 516 | def resize(self, sidewalk, cross_probability, rng=None): |
| 517 | if rng is None: |
no test coverage detected