MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / rand_path

Method rand_path

PythonAPI/examples/gamma_crowd.py:506–514  ·  view source on GitHub ↗
(sidewalk, min_points, interval, cross_probability, segment_map, rng=None)

Source from the content-addressed store, hash-verified

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:

Callers 1

do_spawnFunction · 0.45

Calls 2

resizeMethod · 0.95
SidewalkAgentPathClass · 0.85

Tested by

no test coverage detected