(c, car_agents, bike_agents, pedestrian_agents, destroy_list, statistics)
| 849 | |
| 850 | |
| 851 | def do_death(c, car_agents, bike_agents, pedestrian_agents, destroy_list, statistics): |
| 852 | |
| 853 | update_time = time.time() |
| 854 | |
| 855 | next_car_agents = [] |
| 856 | next_bike_agents = [] |
| 857 | next_pedestrian_agents = [] |
| 858 | next_destroy_list = [] |
| 859 | |
| 860 | for (agents, next_agents) in zip([car_agents, bike_agents, pedestrian_agents], [next_car_agents, next_bike_agents, next_pedestrian_agents]): |
| 861 | for agent in agents: |
| 862 | delete = False |
| 863 | if not delete and not c.bounds_occupancy.contains(get_position(agent.actor)): |
| 864 | delete = True |
| 865 | if not delete and get_position_3d(agent.actor).z < -10: |
| 866 | delete = True |
| 867 | if not delete and \ |
| 868 | ((agent.type_tag in ['Car', 'Bicycle']) and not c.sumo_network_occupancy.contains(get_position(agent.actor))): |
| 869 | delete = True |
| 870 | if get_velocity(agent.actor).length() < c.args.stuck_speed: |
| 871 | if agent.stuck_time is not None: |
| 872 | if update_time - agent.stuck_time >= c.args.stuck_duration: |
| 873 | if agents == car_agents: |
| 874 | statistics.stuck_num_cars += 1 |
| 875 | elif agents == bike_agents: |
| 876 | statistics.stuck_num_bikes += 1 |
| 877 | elif agents == pedestrian_agents: |
| 878 | statistics.stuck_num_pedestrians += 1 |
| 879 | delete = True |
| 880 | else: |
| 881 | agent.stuck_time = update_time |
| 882 | else: |
| 883 | agent.stuck_time = None |
| 884 | |
| 885 | if delete: |
| 886 | next_destroy_list.append(agent.actor.id) |
| 887 | else: |
| 888 | next_agents.append(agent) |
| 889 | |
| 890 | return (next_car_agents, next_bike_agents, next_pedestrian_agents, next_destroy_list, statistics) |
| 891 | |
| 892 | |
| 893 | def do_speed_statistics(c, car_agents, bike_agents, pedestrian_agents, statistics): |
no test coverage detected