huawei-noah / SMARTS

Scalable Multi-Agent RL Training School for Autonomous Driving
MIT License
952 stars 190 forks source link

Some agents are missing after environment reset #1956

Closed 98luobo closed 1 year ago

98luobo commented 1 year ago

High Level Description

I was building a multi-agent scenario using smarts.env:hiway-v1, but I found that whenever I calledenv.reset(), the environment would return fewer agents than I had set with some probability. I suspected that there was a collision during reset initialization and the agents would automatically log off. Is there any good solution?

my test code:

import time

import gym
from envs.multiagentenv import MultiAgentEnv
from utils.dict2namedtuple import convert

from smarts.core.agent_interface import AgentInterface, AgentType

import numpy as np
import gymnasium  # for hiway-v1

from smarts.env.utils.action_conversion import ActionOptions, ActionSpacesFormatter
from smarts.env.utils.observation_conversion import (
    ObservationOptions,
    ObservationSpacesFormatter,
)

def clean_dict_values(d):
    res = []
    for k, v in d.items():
        if isinstance(v, dict):
            res.extend(clean_dict_values(v))
        elif isinstance(v, np.ndarray):
            res.extend(v.flatten().tolist())
        elif isinstance(v, (int, float)):
            res.append(float(v))
    return res

class SMARTSEnv(MultiAgentEnv):
    def __init__(self, **kwargs):
        self.episode_limit = kwargs['episode_limit']
        self.n_agents = kwargs['agent_num']
        self.seed = kwargs['seed']
        self.agent_ids = ["Agent_%i" % i for i in range(self.n_agents)]
        self.n_actions = 4
        self.scenarios = [kwargs['scenarios']]

        self.headless = kwargs['headless']
        self.visdom = kwargs['visdom']
        self.agent_interface = {
            agent_id: AgentInterface.from_type(
                AgentType.Laner,
                max_episode_steps=self.episode_limit
            )
            for agent_id in self.agent_ids

        }

        self.base_env = gymnasium.make(
            "smarts.env:hiway-v1",
            scenarios=self.scenarios,
            agent_interfaces=self.agent_interface,
            headless=self.headless,
            visdom=self.visdom,
            observation_options=ObservationOptions.multi_agent,
            action_options=ActionOptions.multi_agent,
            seed=self.seed
        )

        self.current_observations, _ = self.base_env.reset()
        print(self.current_observations.keys())

        pass

    def reset(self):
        try:
            self.current_observations, _ = self.base_env.reset()
        except:
            self.base_env.close()
            self.base_env = gymnasium.make(
                "smarts.env:hiway-v1",
                scenarios=self.scenarios,
                agent_interfaces=self.agent_interface,
                headless=self.headless,
                visdom=self.visdom,
                observation_options=ObservationOptions.multi_agent,
                action_options=ActionOptions.multi_agent,
                seed=self.seed
            )
            self.current_observations, _ = self.base_env.reset()
        print(self.current_observations.keys())

        return self.get_obs(), self.get_state()
        pass

    def close(self):
        self.base_env.close()
        pass

    def step(self, actions):
        print(type(actions))
        print(actions)
        actions = dict(zip(self.agent_ids, actions.tolist()))
        print(actions)
        # sys.exit()
        self.current_observations, rewards, dones, truncated, infos = self.base_env.step(actions)
        print(self.current_observations)
        print(type(self.current_observations))
        print(rewards)
        print(dones)
        print(truncated)
        print(infos)
        sys.exit()
        r_n = []
        d_n = []
        for agent_id in self.agent_ids:
            r_n.append(rewards.get(agent_id, 0.))
            d_n.append(dones.get(agent_id, True))
        return sum(r_n), d_n, {}

        pass

    def get_obs(self):
        obs_n = []
        for agent_id in self.agent_ids:
            ego_state_dict = self.current_observations[agent_id]['ego_vehicle_state']
            print(ego_state_dict)
            # sys.exit()
            ego_state_dict.pop('lane_id', None)
            ego_state_dict.pop('box', None)
            ego_state = clean_dict_values(ego_state_dict)
            obs_n.append(ego_state)
        return obs_n
        pass

    def get_obs_agent(self, agent_id):
        return self.get_obs()[agent_id]
        pass

    def get_obs_size(self):
        return len(self.get_obs_agent(0))
        pass

    def get_state_size(self):
        return self.get_obs_size() * self.n_agents
        pass

    def get_state(self):
        return np.asarray(self.get_obs()).flatten()
        pass

    def get_avail_actions(self):
        avail_actions = []
        for agent_id in range(self.n_agents):
            avail_agent = self.get_avail_agent_actions(agent_id)
            avail_actions.append(avail_agent)
        return avail_actions
        pass

    def get_avail_agent_actions(self, agent_id):
        return np.ones(self.n_actions)
        pass

    def get_total_actions(self):
        return self.n_actions
        pass

    def get_stats(self):
        return None

    def render(self):
        raise NotImplementedError

    def close(self):
        pass

    def seed(self):
        raise NotImplementedError

    pass

Version

1.0.11

Operating System

ubuntu18.04

Problems

I was building a multi-agent scenario using smarts.env:hiway-v1, but I found that whenever I calledenv.reset(), the environment would return fewer agents than I had set with some probability. I suspected that there was a collision during reset initialization and the agents would automatically log off. Is there any good solution?

98luobo commented 1 year ago

[DEBUG 16:15:03] tensorflow Falling back to TensorFlow client; we recommended you install the Cloud TPU client directly with pip install cloud-tpu-client. 2023-04-13 16:15:03.882226: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT [DEBUG 16:15:03] h5py._conv Creating converter from 7 to 5 [DEBUG 16:15:03] h5py._conv Creating converter from 5 to 7 [DEBUG 16:15:03] h5py._conv Creating converter from 7 to 5 [DEBUG 16:15:03] h5py._conv Creating converter from 5 to 7 [DEBUG 16:15:04] trimesh falling back to MD5 hashing: pip install xxhash for 30x faster cache checks [DEBUG 16:15:04] AgentManager Tearing down AgentManager [DEBUG 16:15:04] SumoTrafficSimulation Tearing down SUMO traffic sim SumoTrafficSim( _scenario=None, _time_resolution=0.1, _headless=True, _cumulative_sim_seconds=0, _non_sumo_vehicle_ids=set(), _sumo_vehicle_ids=set(), _is_setup=False, _last_trigger_time=-1000000, _num_dynamic_ids_used=0, _traci_conn=None ) [DEBUG 16:15:04] SumoTrafficSimulation Nothing to teardown [DEBUG 16:15:04] SumoTrafficSimulation Setting up SumoTrafficSim SumoTrafficSim( _scenario=None, _time_resolution=0.1, _headless=True, _cumulative_sim_seconds=0, _non_sumo_vehicle_ids=set(), _sumo_vehicle_ids=set(), _is_setup=False, _last_trigger_time=-1000000, _num_dynamic_ids_used=0, _traci_conn=None ) [DEBUG 16:15:04] root Starting sumo process: ['/home/xxx/anaconda3/envs/py38_smart/lib/python3.8/site-packages/sumo/bin/sumo', '--remote-port=44365', '--num-clients=1', '--net-file=/home/xxx/smarts/scenarios/sumo/loop/map.net.xml', '--quit-on-end', '--log=/home/xxx/.smarts/_sumo_run_logs/sumo-e98454fe', '--error-log=/home/xxx/.smarts/_sumo_run_logs/sumo-e98454fe', '--no-step-log', '--no-warnings=1', '--seed=1127092023', '--time-to-teleport=-1', '--collision.check-junctions=true', '--collision.action=none', '--lanechange.duration=3.0', '--step-length=0.100000', '--default.action-step-length=0.100000', '--begin=0', '--end=31536000', '--additional-files=/home/xxx/smarts/scenarios/sumo/loop/rerouter.add.xml', '--start', '--route-files=/home/xxx/smarts/scenarios/sumo/loop/build/traffic/basic.rou.xml'] [DEBUG 16:15:05] SumoTrafficSimulation Finished starting sumo process [DEBUG 16:15:05] VehicleIndex Tearing down vehicle ids: set() [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633931_0_random-445633932_0_max--8872063773308225556---2130553413876864870--endless-2-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633931_0_random-445633932_0_max--8872063773308225556---5481682861420388098--endless-6-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633931_1_random-445633932_0_max-2891830898934547453---3925330266029679230--endless-16-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633931_1_random-445633932_0_max-2891830898934547453---4408281014321500977--endless-22-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633931_2_random-445633932_0_max-6765479504201222794---2130553413876864870--endless-0-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633931_2_random-445633932_0_max-6765479504201222794---2130553413876864870--endless-20-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_0_random-445633931_1_max--5226483183952079403---2130553413876864870--endless-13-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_0_random-445633931_1_max--5226483183952079403--2338792407115996549--endless-23-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_0_random-445633931_2_max-3796886287426974533---3925330266029679230--endless-11-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_0_random-445633931_2_max-3796886287426974533---4408281014321500977--endless-21-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_1_random-445633931_0_max-2182261526775445995---3925330266029679230--endless-9-0.0 entered simulation [DEBUG 16:15:05] SumoTrafficSimulation SUMO vehicle car-flow-route-445633932_2_random-445633931_0_max--7779908317845345820---3925330266029679230--endless-17-0.0 entered simulation [DEBUG 16:15:05] VehicleIndex Tearing down vehicle ids: set() [INFO 16:15:05] Vehicle replacing existing trip_meter_sensor on vehicle Agent_2 [INFO 16:15:05] Vehicle replacing existing driven_path_sensor on vehicle Agent_2 [INFO 16:15:05] Vehicle replacing existing accelerometer_sensor on vehicle Agent_2 [INFO 16:15:05] Vehicle replacing existing lane_position_sensor on vehicle Agent_2 [INFO 16:15:05] Vehicle replacing existing waypoints_sensor on vehicle Agent_2 [INFO 16:15:05] Vehicle replacing existing via_sensor on vehicle Agent_2 [INFO 16:15:05] Vehicle replacing existing trip_meter_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing driven_path_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing accelerometer_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing lane_position_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing waypoints_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing via_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [DEBUG 16:15:05] VehicleIndex Switching control of Agent_3 to car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [DEBUG 16:15:05] VehicleIndex Tearing down vehicle ids: ['car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0'] [INFO 16:15:05] Vehicle replacing existing trip_meter_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing driven_path_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing accelerometer_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing lane_position_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing waypoints_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing via_sensor on vehicle car-flow-route-445633932_0_random-445633931_0_max-879489216878698016---2130553413876864870--endless-5-0.0 [INFO 16:15:05] Vehicle replacing existing trip_meter_sensor on vehicle Agent_1 [INFO 16:15:05] Vehicle replacing existing driven_path_sensor on vehicle Agent_1 [INFO 16:15:05] Vehicle replacing existing accelerometer_sensor on vehicle Agent_1 [INFO 16:15:05] Vehicle replacing existing lane_position_sensor on vehicle Agent_1 [INFO 16:15:05] Vehicle replacing existing waypoints_sensor on vehicle Agent_1 [INFO 16:15:05] Vehicle replacing existing via_sensor on vehicle Agent_1 [DEBUG 16:15:05] root Agent Agent_2 has raised done with Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False) [DEBUG 16:15:05] root Agent Agent_3 has raised done with Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False) [DEBUG 16:15:05] root Agent Agent_1 has raised done with Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False) [DEBUG 16:15:05] VehicleIndex Tearing down vehicle ids: set() [DEBUG 16:15:05] pymarl Stopping Heartbeat [ERROR 16:15:05] pymarl Failed after 0:00:02! Traceback (most recent calls WITHOUT Sacred internals): File "main.py", line 35, in my_main run(_run, config, _log) File "/home/xxx/QMIX_SMART/run.py", line 48, in run run_sequential(args=args, logger=logger) File "/home/xxx/QMIX_SMART/run.py", line 82, in run_sequential env_info = runner.get_env_info() File "/home/xxx/QMIX_SMART/runners/episode_runner.py", line 37, in get_env_info return self.env.get_env_info() File "/home/xxx/QMIX_SMART/envs/multiagentenv.py", line 55, in get_env_info env_info = {"state_shape": self.get_state_size(), File "/home/xxx/QMIX_SMART/envs/smarts_env.py", line 161, in get_state_size return self.get_obs_size() * self.n_agents File "/home/xxx/QMIX_SMART/envs/smarts_env.py", line 157, in get_obs_size return len(self.get_obs_agent(0)) File "/home/xxx/QMIX_SMART/envs/smarts_env.py", line 153, in get_obs_agent return self.get_obs()[agent_id] File "/home/xxx/QMIX_SMART/envs/smarts_env.py", line 137, in get_obs print(self.current_observations['Agent_0']) KeyError: 'Agent_0'

98luobo commented 1 year ago

I uploaded the error message that appeared and can see that Agent_0 was not created '[DEBUG 16:15:05]'. Does anyone know what's causing this problem? I doubt it's a simple collision problem.

Adaickalavan commented 1 year ago

Hi @98luobo,

98luobo commented 1 year ago

Thank you for your reply.

I uploaded the complete project file, which is based on '''Pymarl'''. Although I know '''SMARTS''' has removed this part, this is what I tried to write myself using '''smarts.env:hiway-v1'''. It will inadvertently cause the BUG of missing agent after reset. The modification I have made is to reset the environment multiple times, but this does not fundamentally solve the BUG.

It works on python3.8, you just need to install the necessary packages to get it working. The data is automatically saved in the ''' .. / A_DATA /.. '''.

https://github.com/98luobo/QMIX_SMART_for_test

98luobo commented 1 year ago

Is it because the loop scene only has three lanes, and I created four cars?... ... ... ...

Sorry, I still don't quite understand the SMARTS generation and control logic, and I find it inefficient and unstable.

98luobo commented 1 year ago

I tried rewriting the above code with RLlibHiWayEnv and it turned out that the first time reset() happened, the agent was missing. code

import time

import gym
from envs.multiagentenv import MultiAgentEnv
from utils.dict2namedtuple import convert

import os
import sys
import gym
import numpy as np
from smarts.core.agent_interface import AgentInterface, AgentType
from smarts.core.agent import Agent
from smarts.env.rllib_hiway_env import RLlibHiWayEnv
from smarts.zoo.agent_spec import AgentSpec
from smarts.env.utils.action_conversion import ActionOptions, ActionSpacesFormatter
from smarts.env.utils.observation_conversion import (
    ObservationOptions,
    ObservationSpacesFormatter,
)

def action_adapter(policy_action):
    if isinstance(policy_action, (list, tuple, np.ndarray)):
        action = np.argmax(policy_action)
    else:
        action = policy_action
    action_dict = ["keep_lane", "slow_down", "change_lane_left", "change_lane_right"]
    return action_dict[action]

def reward_adapter(env_obs, env_reward):
    return env_reward

def observation_adapter(env_obs):
    return env_obs

class SMARTSEnv(MultiAgentEnv):
    def __init__(self, ):
        self.episode_limit = 300
        self.n_agents = 4
        self.seed = 42
        self.agent_ids = ["Agent_%i" % i for i in range(self.n_agents)]
        self.n_actions = 4
        self.scenarios = ["/home/xxx/smarts/scenarios/sumo/loop"]

        self.headless = True
        self.visdom = False
        self.agent_specs = {
            agent_id: AgentSpec(
                interface=AgentInterface.from_type(AgentType.Laner,
                                                   max_episode_steps=self.episode_limit),
                action_adapter=action_adapter,
                observation_adapter=observation_adapter,
                reward_adapter=reward_adapter
            )
            for agent_id in self.agent_ids
        }

        self.base_env = RLlibHiWayEnv(
            config={
                "agent_specs": self.agent_specs,
                "scenarios": self.scenarios,
                "seed": self.seed
            }
        )

        self.current_observation = None

        pass

    def reset(self):
        self.current_observation = self.base_env.reset()
        print(self.current_observation)
        pass

    pass

if __name__ == "__main__":
    env = SMARTSEnv()
    base_env = env.base_env
    env.reset()

Output

{'Agent_3': Observation(dt=0.01, step_count=9, steps_completed=1, elapsed_sim_time=0.1, events=Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False), ego_vehicle_state=EgoVehicleObservation(id='car-flow-route-445633931_2_random-445633932_1_max--3907184823999348734---2130553413876864870--endless-10-0.0', position=array([187.77762105,  54.23592562,   0.        ]), bounding_box=Dimensions(length=3.68, width=1.47, height=1.0), heading=Heading(0.3201280571724645), speed=16.91168373270546, steering=-0.0, yaw_rate=4.71238898038469, road_id='445633931', lane_id='445633931_2', lane_index=2, mission=Mission(start=Start(position=array([187.77762105,  54.23592562]), heading=Heading(0.3201280571724645), from_front_bumper=True), goal=EndlessGoal(), route_vias=(), start_time=0.1, entry_tactic=TrapEntryTactic(wait_to_hijack_limit_s=0, zone=None, exclusion_prefixes=(), default_entry_speed=None), via=(), vehicle_spec=None), linear_velocity=array([1.69116837e+01, 8.88178420e-16, 0.00000000e+00]), angular_velocity=array([0., 0., 0.]), linear_acceleration=array([0., 0., 0.]), angular_acceleration=array([0., 0., 0.]), linear_jerk=array([0., 0., 0.]), angular_jerk=array([0., 0., 0.]), lane_position=RefLinePoint(s=106.9013513469271, t=7.105427357601002e-15, h=0)), under_this_agent_control=True, neighborhood_vehicle_states=None, waypoint_paths=[[Waypoint(pos=array([193.85292239,  56.25746075]), heading=Heading(0.32122229242782024), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=121.13414843727568), Waypoint(pos=array([193.52001407,  57.25794714]), heading=Heading(0.32946289498284037), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=122.15379977477558), Waypoint(pos=array([193.18710574,  58.25843354]), heading=Heading(0.3377034975378605), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=123.17345111227547), Waypoint(pos=array([192.85419742,  59.25891993]), heading=Heading(0.3459441000928806), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=124.19310244977538), Waypoint(pos=array([192.52128909,  60.25940632]), heading=Heading(0.3541847026479007), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=125.21275378727528), Waypoint(pos=array([192.18838077,  61.25989272]), heading=Heading(0.3624253052029208), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=126.23240512477517), Waypoint(pos=array([191.85547244,  62.26037911]), heading=Heading(0.37066590775794095), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=127.25205646227506), Waypoint(pos=array([191.52256412,  63.26086551]), heading=Heading(0.3789065103129611), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=128.27170779977496), Waypoint(pos=array([191.17810439,  64.25709025]), heading=Heading(0.3866735630396262), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=129.29766138670752), Waypoint(pos=array([190.78146899,  65.23406585]), heading=Heading(0.39230167483459916), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=130.35208112116257), Waypoint(pos=array([190.38483359,  66.21104146]), heading=Heading(0.3979297866295721), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=131.40650085561765), Waypoint(pos=array([189.9881982 ,  67.18801707]), heading=Heading(0.4035578984245451), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=132.46092059007273), Waypoint(pos=array([189.5915628 ,  68.16499268]), heading=Heading(0.40918601021951806), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=133.51534032452778), Waypoint(pos=array([189.19492741,  69.14196829]), heading=Heading(0.4148141220144911), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=134.56976005898287), Waypoint(pos=array([188.79829201,  70.11894389]), heading=Heading(0.42044223380946405), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=135.62417979343795), Waypoint(pos=array([188.40165661,  71.0959195 ]), heading=Heading(0.426070345604437), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=136.678599527893), Waypoint(pos=array([188.00502122,  72.07289511]), heading=Heading(0.43169845739941), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=137.73301926234808), Waypoint(pos=array([187.60838582,  73.04987072]), heading=Heading(0.43732656919438295), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=138.78743899680316), Waypoint(pos=array([187.1804689 ,  74.01315309]), heading=Heading(0.4590207271449759), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=139.8418587312582), Waypoint(pos=array([186.73175636,  74.96733233]), heading=Heading(0.4913954240402727), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=140.8962784657133), Waypoint(pos=array([186.28304381,  75.92151157]), heading=Heading(0.5237701209355695), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=141.95069820016835), Waypoint(pos=array([185.83433127,  76.87569082]), heading=Heading(0.5561448178308662), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=143.00511793462343), Waypoint(pos=array([185.38561873,  77.82987006]), heading=Heading(0.588519514726163), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=144.0595376690785), Waypoint(pos=array([184.93690618,  78.7840493 ]), heading=Heading(0.6208942116214597), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=145.11395740353356), Waypoint(pos=array([184.32868362,  79.64458798]), heading=Heading(0.6747561413286609), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=146.16837713798864), Waypoint(pos=array([183.71421588,  80.50146042]), heading=Heading(0.7294593441289192), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=147.2227968724437), Waypoint(pos=array([183.09974815,  81.35833286]), heading=Heading(0.7841625469291774), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=148.27721660689878), Waypoint(pos=array([182.42155778,  82.1594118 ]), heading=Heading(0.8376254809037449), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=149.33163634135383), Waypoint(pos=array([181.65337004,  82.88169192]), heading=Heading(0.8893367458680543), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=150.3860560758089), Waypoint(pos=array([180.88518229,  83.60397203]), heading=Heading(0.9410480108323639), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=151.440475810264), Waypoint(pos=array([180.1007364 ,  84.30573606]), heading=Heading(0.9851522094403632), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=152.49489554471904), Waypoint(pos=array([179.22202914,  84.8885521 ]), heading=Heading(0.9851522094403632), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=153.54931527917412), Waypoint(pos=array([178.34332188,  85.47136814]), heading=Heading(0.9851522094403632), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=154.60373501362918)], [Waypoint(pos=array([190.81581197,  55.24504869]), heading=Heading(0.3206816077166652), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=114.19156122295037), Waypoint(pos=array([190.49373809,  56.21472418]), heading=Heading(0.328825672823046), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=115.17483088950064), Waypoint(pos=array([190.17166422,  57.18439967]), heading=Heading(0.33696973792942675), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=116.15810055605091), Waypoint(pos=array([189.84959035,  58.15407516]), heading=Heading(0.3451138030358075), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=117.14137022260118), Waypoint(pos=array([189.52751648,  59.12375065]), heading=Heading(0.3532578681421883), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=118.12463988915145), Waypoint(pos=array([189.20544261,  60.09342614]), heading=Heading(0.361401933248569), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=119.10790955570171), Waypoint(pos=array([188.88336874,  61.06310163]), heading=Heading(0.3695459983549498), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=120.09117922225198), Waypoint(pos=array([188.56129487,  62.03277712]), heading=Heading(0.37769006346133055), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=121.07444888880225), Waypoint(pos=array([188.23713963,  63.00168547]), heading=Heading(0.3857503685237793), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=122.05900687160089), Waypoint(pos=array([187.85287501,  63.94843932]), heading=Heading(0.39139170502161524), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=123.08077109689623), Waypoint(pos=array([187.46861039,  64.89519316]), heading=Heading(0.39703304151945124), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=124.10253532219156), Waypoint(pos=array([187.08434578,  65.841947  ]), heading=Heading(0.4026743780172872), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=125.1242995474869), Waypoint(pos=array([186.70008116,  66.78870084]), heading=Heading(0.40831571451512316), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=126.14606377278223), Waypoint(pos=array([186.31581654,  67.73545468]), heading=Heading(0.41395705101295915), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=127.16782799807757), Waypoint(pos=array([185.93155193,  68.68220852]), heading=Heading(0.41959838751079515), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=128.1895922233729), Waypoint(pos=array([185.54728731,  69.62896236]), heading=Heading(0.4252397240086311), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=129.21135644866823), Waypoint(pos=array([185.16302269,  70.57571621]), heading=Heading(0.4308810605064671), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=130.23312067396358), Waypoint(pos=array([184.77875808,  71.52247005]), heading=Heading(0.43652239700430306), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=131.2548848992589), Waypoint(pos=array([184.37775706,  72.46189113]), heading=Heading(0.45125351996007346), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=132.27664912455424), Waypoint(pos=array([183.94225046,  73.38619418]), heading=Heading(0.4847251456065429), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=133.2984133498496), Waypoint(pos=array([183.50674385,  74.31049723]), heading=Heading(0.5181967712530122), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=134.32017757514492), Waypoint(pos=array([183.07123725,  75.23480028]), heading=Heading(0.5516683968994817), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=135.34194180044025), Waypoint(pos=array([182.63573064,  76.15910333]), heading=Heading(0.585140022545951), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=136.3637060257356), Waypoint(pos=array([182.20022403,  77.08340638]), heading=Heading(0.6186116481924204), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=137.38547025103094), Waypoint(pos=array([181.62296747,  77.92438959]), heading=Heading(0.6779456797020142), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=138.40723447632627), Waypoint(pos=array([181.02723289,  78.75451154]), heading=Heading(0.7406510402727234), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=139.4289987016216), Waypoint(pos=array([180.43149832,  79.58463349]), heading=Heading(0.8033564008434328), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=140.45076292691695), Waypoint(pos=array([179.71554961,  80.30957825]), heading=Heading(0.8648728634250146), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=141.47252715221228), Waypoint(pos=array([178.97192088,  81.01030533]), heading=Heading(0.9261155750745691), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=142.4942913775076), Waypoint(pos=array([178.22658286,  81.70887515]), heading=Heading(0.9869790926268617), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=143.51605560280294), Waypoint(pos=array([177.37438857,  82.27258343]), heading=Heading(1.0241371566786794), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=144.5378198280983), Waypoint(pos=array([176.52219429,  82.83629172]), heading=Heading(1.061295220730497), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=145.55958405339362), Waypoint(pos=array([175.67,  83.4 ]), heading=Heading(1.0984532847823147), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=146.58134827868895)], [Waypoint(pos=array([187.77762105,  54.23592562]), heading=Heading(0.3201280571724663), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=107.23937972444567), Waypoint(pos=array([187.4276541 ,  55.29153247]), heading=Heading(0.32917459414557465), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=108.30468463299657), Waypoint(pos=array([187.07768714,  56.34713932]), heading=Heading(0.338221131118683), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=109.36998954154745), Waypoint(pos=array([186.72772019,  57.40274617]), heading=Heading(0.3472676680917914), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=110.43529445009835), Waypoint(pos=array([186.37775323,  58.45835302]), heading=Heading(0.35631420506489975), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=111.50059935864925), Waypoint(pos=array([186.02778628,  59.51395987]), heading=Heading(0.3653607420380081), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=112.56590426720015), Waypoint(pos=array([185.67781932,  60.56956672]), heading=Heading(0.3744072790111165), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=113.63120917575104), Waypoint(pos=array([185.32785236,  61.62517357]), heading=Heading(0.3834538159842249), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=114.69651408430194), Waypoint(pos=array([184.92487586,  62.66126222]), heading=Heading(0.3904153758968495), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=115.79820991214382), Waypoint(pos=array([184.50673325,  63.69176669]), heading=Heading(0.39678042096187965), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=116.91031723279592), Waypoint(pos=array([184.08859064,  64.72227115]), heading=Heading(0.4031454660269098), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=118.022424553448), Waypoint(pos=array([183.67044803,  65.75277562]), heading=Heading(0.40951051109194), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=119.13453187410009), Waypoint(pos=array([183.25230542,  66.78328008]), heading=Heading(0.41587555615697014), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=120.24663919475219), Waypoint(pos=array([182.83416281,  67.81378454]), heading=Heading(0.4222406012220003), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=121.35874651540428), Waypoint(pos=array([182.4160202 ,  68.84428901]), heading=Heading(0.42860564628703046), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=122.47085383605636), Waypoint(pos=array([181.99787759,  69.87479347]), heading=Heading(0.4349706913520606), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=123.58296115670846), Waypoint(pos=array([181.57834221,  70.90468708]), heading=Heading(0.44213858295789443), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=124.69506847736055), Waypoint(pos=array([181.10346537,  71.91030862]), heading=Heading(0.4812073599982165), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=125.80717579801264), Waypoint(pos=array([180.62858853,  72.91593016]), heading=Heading(0.5202761370385387), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=126.91928311866474), Waypoint(pos=array([180.1537117,  73.9215517]), heading=Heading(0.5593449140788609), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=128.03139043931682), Waypoint(pos=array([179.67883486,  74.92717324]), heading=Heading(0.5984136911191831), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=129.14349775996894), Waypoint(pos=array([179.13945123,  75.89481789]), heading=Heading(0.6539502303192886), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=130.25560508062102), Waypoint(pos=array([178.490566  ,  76.79799597]), heading=Heading(0.7374411321149995), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=131.3677124012731), Waypoint(pos=array([177.82737037,  77.68866802]), heading=Heading(0.8211149991750917), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=132.4798197219252), Waypoint(pos=array([177.0192613,  78.4526984]), heading=Heading(0.9066416525528406), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=133.59192704257728), Waypoint(pos=array([176.20536172,  79.20942068]), heading=Heading(0.9902359213880022), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=134.70403436322937), Waypoint(pos=array([175.27679859,  79.8214282 ]), heading=Heading(1.035565213026124), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=135.81614168388148), Waypoint(pos=array([174.34823546,  80.43343572]), heading=Heading(1.0808945046642455), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=136.92824900453357), Waypoint(pos=array([173.3787725 ,  80.97548474]), heading=Heading(1.1165618597766431), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=138.04035632518566), Waypoint(pos=array([172.38995806,  81.48443335]), heading=Heading(1.1476577321850396), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=139.15246364583777), Waypoint(pos=array([171.38230544,  81.95370402]), heading=Heading(1.1872168955071445), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=140.26457096648986), Waypoint(pos=array([170.36289682,  82.3982136 ]), heading=Heading(1.2320575926101491), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=141.37667828714194), Waypoint(pos=array([169.315,  82.77 ]), heading=Heading(1.2352641028890041), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=142.48878560779403)]], distance_travelled=0.0, lidar_point_cloud=None, drivable_area_grid_map=None, occupancy_grid_map=None, top_down_rgb=None, road_waypoints=None, via_data=Vias(near_via_points=[], hit_via_points=[]), signals=None), 'Agent_1': Observation(dt=0.01, step_count=9, steps_completed=1, elapsed_sim_time=0.1, events=Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False), ego_vehicle_state=EgoVehicleObservation(id='car-flow-route-445633932_0_random-445633931_1_max--5226483183952079403--2338792407115996549--endless-23-0.0', position=array([11.89021433,  1.30938556,  0.        ]), bounding_box=Dimensions(length=3.68, width=1.47, height=1.0), heading=Heading(-2.1612996088591077), speed=8.770931004420207, steering=-0.0, yaw_rate=4.71238898038469, road_id='445633932', lane_id='445633932_0', lane_index=0, mission=Mission(start=Start(position=array([11.89021433,  1.30938556]), heading=Heading(-2.1612996088591077), from_front_bumper=True), goal=EndlessGoal(), route_vias=(), start_time=0.1, entry_tactic=TrapEntryTactic(wait_to_hijack_limit_s=0, zone=None, exclusion_prefixes=(), default_entry_speed=None), via=(), vehicle_spec=None), linear_velocity=array([8.77093100e+00, 1.77635684e-15, 0.00000000e+00]), angular_velocity=array([0., 0., 0.]), linear_acceleration=array([0., 0., 0.]), angular_acceleration=array([0., 0., 0.]), linear_jerk=array([0., 0., 0.]), angular_jerk=array([0., 0., 0.]), lane_position=RefLinePoint(s=177.64946760819157, t=0.5456893569394587, h=0)), under_this_agent_control=True, neighborhood_vehicle_states=None, waypoint_paths=[[Waypoint(pos=array([11.66077323,  0.81427582]), heading=Heading(-2.004749696188794), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=177.75586708428165), Waypoint(pos=array([12.62104698,  0.36927091]), heading=Heading(-1.96624743184862), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=178.79163242522884), Waypoint(pos=array([13.58132073, -0.075734  ]), heading=Heading(-1.927745167508446), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=179.82739776617603), Waypoint(pos=array([14.54159448, -0.5207389 ]), heading=Heading(-1.889242903168272), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=180.86316310712323), Waypoint(pos=array([15.50186823, -0.96574381]), heading=Heading(-1.850740638828098), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=181.89892844807042), Waypoint(pos=array([16.48108493, -1.35776366]), heading=Heading(-1.813475855355776), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=182.94133646483633), Waypoint(pos=array([17.50583127, -1.62243324]), heading=Heading(-1.7791853726549824), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=183.9997102361653), Waypoint(pos=array([18.5305776 , -1.88710282]), heading=Heading(-1.744894889954188), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=185.05808400749424), Waypoint(pos=array([19.55532394, -2.15177241]), heading=Heading(-1.7106044072533946), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=186.1164577788232), Waypoint(pos=array([20.58007027, -2.41644199]), heading=Heading(-1.6763139245526002), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=187.17483155015216), Waypoint(pos=array([21.60481661, -2.68111157]), heading=Heading(-1.6420234418518067), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=188.2332053214811), Waypoint(pos=array([22.64246061, -2.86141239]), heading=Heading(-1.6098999875629287), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=189.29157909281005), Waypoint(pos=array([23.69947753, -2.91498722]), heading=Heading(-1.5810315149960594), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=190.34995286413903), Waypoint(pos=array([24.75649446, -2.96856205]), heading=Heading(-1.552163042429191), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=191.40832663546797), Waypoint(pos=array([25.81351138, -3.02213688]), heading=Heading(-1.5232945698623217), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=192.46670040679692), Waypoint(pos=array([26.87052831, -3.07571171]), heading=Heading(-1.4944260972954524), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=193.5250741781259), Waypoint(pos=array([27.92754523, -3.12928654]), heading=Heading(-1.465557624728584), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=194.58344794945484), Waypoint(pos=array([28.98456215, -3.18286137]), heading=Heading(-1.4366891521617147), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=195.64182172078378), Waypoint(pos=array([30.03648296, -3.13261167]), heading=Heading(-1.4161633789615111), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=196.70019549211275), Waypoint(pos=array([31.08317226, -2.97577875]), heading=Heading(-1.4042019772779977), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=197.7585692634417), Waypoint(pos=array([32.12986155, -2.81894583]), heading=Heading(-1.3922405755944833), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=198.81694303477067), Waypoint(pos=array([33.17655084, -2.6621129 ]), heading=Heading(-1.3802791739109699), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=199.87531680609962), Waypoint(pos=array([34.22324013, -2.50527998]), heading=Heading(-1.3683177722274564), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=200.93369057742856), Waypoint(pos=array([35.26992942, -2.34844706]), heading=Heading(-1.356356370543942), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=201.99206434875754), Waypoint(pos=array([36.30810521, -2.14582109]), heading=Heading(-1.3460140542415981), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=203.05043812008648), Waypoint(pos=array([37.34122346, -1.91599133]), heading=Heading(-1.3366335709632926), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=204.10881189141543), Waypoint(pos=array([38.37434171, -1.68616156]), heading=Heading(-1.327253087684987), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=205.1671856627444), Waypoint(pos=array([39.40745996, -1.4563318 ]), heading=Heading(-1.3178726044066806), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=206.22555943407335), Waypoint(pos=array([40.43903735, -1.22020329]), heading=Heading(-1.3098593376922079), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=207.2839332054023), Waypoint(pos=array([41.46158377, -0.94715774]), heading=Heading(-1.3098593376922079), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=208.34230697673124), Waypoint(pos=array([42.48413018, -0.67411219]), heading=Heading(-1.3098593376922079), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=209.4006807480602), Waypoint(pos=array([43.50667659, -0.40106664]), heading=Heading(-1.3098593376922079), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=210.45905451938916), Waypoint(pos=array([44.52922301, -0.1280211 ]), heading=Heading(-1.3098593376922079), lane_id='445633932_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=211.5174282907181)], [Waypoint(pos=array([13.00779824,  3.72074904]), heading=Heading(-2.0047916126074306), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=168.92809073276197), Waypoint(pos=array([14.02818894,  3.2478331 ]), heading=Heading(-1.9613981067238209), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=169.9550180251049), Waypoint(pos=array([15.04857963,  2.77491716]), heading=Heading(-1.9180046008402112), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=170.98194531744778), Waypoint(pos=array([16.06897033,  2.30200123]), heading=Heading(-1.8746110949566006), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=172.0088726097907), Waypoint(pos=array([17.08936102,  1.82908529]), heading=Heading(-1.831217589072991), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=173.0357999021336), Waypoint(pos=array([18.16672537,  1.515416  ]), heading=Heading(-1.7903403441264985), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=174.1441111688865), Waypoint(pos=array([19.25553063,  1.2337251 ]), heading=Heading(-1.7499683905396157), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=175.26876518391066), Waypoint(pos=array([20.34433589,  0.9520342 ]), heading=Heading(-1.709596436952733), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=176.39341919893482), Waypoint(pos=array([21.43314115,  0.6703433 ]), heading=Heading(-1.6692244833658512), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=177.51807321395898), Waypoint(pos=array([22.52194641,  0.3886524 ]), heading=Heading(-1.6288525297789684), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=178.64272722898315), Waypoint(pos=array([23.63919509,  0.29249228]), heading=Heading(-1.5938539255581663), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=179.7673812440073), Waypoint(pos=array([24.76238203,  0.23506618]), heading=Heading(-1.5599771373722549), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=180.89203525903147), Waypoint(pos=array([25.88556897,  0.17764008]), heading=Heading(-1.5261003491863434), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=182.01668927405564), Waypoint(pos=array([27.00875591,  0.12021398]), heading=Heading(-1.492223561000431), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=183.14134328907983), Waypoint(pos=array([28.13194284,  0.06278788]), heading=Heading(-1.4583467728145196), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=184.265997304104), Waypoint(pos=array([2.92551298e+01, 5.36178565e-03]), heading=Heading(-1.4244699846286082), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=185.39065131912815), Waypoint(pos=array([30.36827496,  0.15185928]), heading=Heading(-1.4091331161432166), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=186.51530533415232), Waypoint(pos=array([31.480386  ,  0.31935761]), heading=Heading(-1.3957055607527984), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=187.63995934917648), Waypoint(pos=array([32.59249703,  0.48685595]), heading=Heading(-1.382278005362381), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=188.76461336420064), Waypoint(pos=array([33.70460807,  0.65435428]), heading=Heading(-1.3688504499719638), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=189.8892673792248), Waypoint(pos=array([34.81671911,  0.82185262]), heading=Heading(-1.3554228945815456), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=191.01392139424897), Waypoint(pos=array([35.91787927,  1.04820638]), heading=Heading(-1.3443909888689776), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=192.13857540927313), Waypoint(pos=array([37.01580986,  1.29191743]), heading=Heading(-1.3340655933785959), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=193.2632294242973), Waypoint(pos=array([38.11374044,  1.53562848]), heading=Heading(-1.323740197888215), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=194.38788343932146), Waypoint(pos=array([39.21167103,  1.77933953]), heading=Heading(-1.3134148023978334), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=195.51253745434565), Waypoint(pos=array([40.3016597 ,  2.05558817]), heading=Heading(-1.3067747994499639), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=196.6371914693698), Waypoint(pos=array([41.38840551,  2.34512264]), heading=Heading(-1.3016396255959428), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=197.76184548439397), Waypoint(pos=array([42.47515131,  2.6346571 ]), heading=Heading(-1.2965044517419209), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=198.88649949941814), Waypoint(pos=array([43.56189712,  2.92419157]), heading=Heading(-1.2913692778878998), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=200.0111535144423), Waypoint(pos=array([44.64864293,  3.21372604]), heading=Heading(-1.2862341040338778), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=201.13580752946646), Waypoint(pos=array([45.73014172,  3.5219772 ]), heading=Heading(-1.2845265921319076), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=202.26046154449062), Waypoint(pos=array([46.80902669,  3.83955221]), heading=Heading(-1.2845265921319076), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=203.3851155595148), Waypoint(pos=array([47.88791165,  4.15712722]), heading=Heading(-1.2845265921319076), lane_id='445633932_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=204.50976957453895)], [Waypoint(pos=array([14.35513283,  6.62710313]), heading=Heading(-2.0048441784258513), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=159.1102585026014), Waypoint(pos=array([15.31122113,  6.18392809]), heading=Heading(-1.961567142969347), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=160.2341803556548), Waypoint(pos=array([16.26730944,  5.74075304]), heading=Heading(-1.9182901075128438), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=161.35810220870817), Waypoint(pos=array([17.22339774,  5.29757799]), heading=Heading(-1.8750130720563405), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=162.48202406176154), Waypoint(pos=array([18.17948604,  4.85440294]), heading=Heading(-1.8317360365998363), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=163.60594591481492), Waypoint(pos=array([19.18882422,  4.55993446]), heading=Heading(-1.7891807601891507), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=164.67152413583682), Waypoint(pos=array([20.20890603,  4.29546881]), heading=Heading(-1.7467711048655081), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=165.7253310279537), Waypoint(pos=array([21.22898783,  4.03100316]), heading=Heading(-1.7043614495418664), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=166.77913792007058), Waypoint(pos=array([22.24906963,  3.7665375 ]), heading=Heading(-1.6619517942182238), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=167.83294481218746), Waypoint(pos=array([23.2713425 ,  3.51631397]), heading=Heading(-1.6200153217103574), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=168.88675170430437), Waypoint(pos=array([24.32374567,  3.46193981]), heading=Heading(-1.58458578434875), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=169.94055859642125), Waypoint(pos=array([25.37614883,  3.40756564]), heading=Heading(-1.5491562469871418), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=170.99436548853814), Waypoint(pos=array([26.42855199,  3.35319148]), heading=Heading(-1.5137267096255345), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=172.04817238065502), Waypoint(pos=array([27.48095515,  3.29881732]), heading=Heading(-1.478297172263927), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=173.10197927277193), Waypoint(pos=array([28.53335832,  3.24444315]), heading=Heading(-1.4428676349023188), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=174.1557861648888), Waypoint(pos=array([29.58191709,  3.26786623]), heading=Heading(-1.4155383159151178), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=175.2095930570057), Waypoint(pos=array([30.6238323 ,  3.42573217]), heading=Heading(-1.4022071370386975), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=176.26339994912257), Waypoint(pos=array([31.66574751,  3.58359811]), heading=Heading(-1.388875958162278), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=177.31720684123948), Waypoint(pos=array([32.70766273,  3.74146405]), heading=Heading(-1.3755447792858586), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=178.37101373335636), Waypoint(pos=array([33.74957794,  3.89932999]), heading=Heading(-1.3622136004094383), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=179.42482062547325), Waypoint(pos=array([34.78759662,  4.0781158 ]), heading=Heading(-1.3498662541510695), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=180.47862751759013), Waypoint(pos=array([35.81647828,  4.30595673]), heading=Heading(-1.3398259025767612), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=181.53243440970704), Waypoint(pos=array([36.84535994,  4.53379766]), heading=Heading(-1.3297855510024537), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=182.58624130182392), Waypoint(pos=array([37.87424161,  4.76163858]), heading=Heading(-1.3197451994281453), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=183.6400481939408), Waypoint(pos=array([38.90177286,  4.99502513]), heading=Heading(-1.3103443655382163), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=184.69385508605768), Waypoint(pos=array([39.9202175 ,  5.26572696]), heading=Heading(-1.3052467112166877), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=185.74766197817456), Waypoint(pos=array([40.93866214,  5.53642879]), heading=Heading(-1.3001490568951581), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=186.80146887029147), Waypoint(pos=array([41.95710678,  5.80713061]), heading=Heading(-1.2950514025736295), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=187.85527576240835), Waypoint(pos=array([42.97555142,  6.07783244]), heading=Heading(-1.2899537482521009), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=188.90908265452524), Waypoint(pos=array([43.99399606,  6.34853427]), heading=Heading(-1.2848560939305713), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=189.96288954664215), Waypoint(pos=array([45.00595574,  6.64237458]), heading=Heading(-1.2840752423205295), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=191.01669643875903), Waypoint(pos=array([46.01674237,  6.94040033]), heading=Heading(-1.2840752423205295), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=192.0705033308759), Waypoint(pos=array([47.02752901,  7.23842608]), heading=Heading(-1.2840752423205295), lane_id='445633932_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=193.1243102229928)]], distance_travelled=0.0, lidar_point_cloud=None, drivable_area_grid_map=None, occupancy_grid_map=None, top_down_rgb=None, road_waypoints=None, via_data=Vias(near_via_points=[], hit_via_points=[]), signals=None), 'Agent_0': Observation(dt=0.01, step_count=9, steps_completed=1, elapsed_sim_time=0.1, events=Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False), ego_vehicle_state=EgoVehicleObservation(id='car-flow-route-445633931_2_random-445633932_0_max-6765479504201222794---2130553413876864870--endless-0-0.0', position=array([162.86115039,  83.28784415,   0.        ]), bounding_box=Dimensions(length=3.68, width=1.47, height=1.0), heading=Heading(1.6194034926765732), speed=10.258829297859648, steering=-0.0, yaw_rate=4.71238898038469, road_id='445633931', lane_id='445633931_2', lane_index=2, mission=Mission(start=Start(position=array([162.86115039,  83.28784415]), heading=Heading(1.6194034926765735), from_front_bumper=True), goal=EndlessGoal(), route_vias=(), start_time=0.1, entry_tactic=TrapEntryTactic(wait_to_hijack_limit_s=0, zone=None, exclusion_prefixes=(), default_entry_speed=None), via=(), vehicle_spec=None), linear_velocity=array([ 1.02588293e+01, -1.60982339e-15,  0.00000000e+00]), angular_velocity=array([0., 0., 0.]), linear_acceleration=array([0., 0., 0.]), angular_acceleration=array([0., 0., 0.]), linear_jerk=array([0., 0., 0.]), angular_jerk=array([0., 0., 0.]), lane_position=RefLinePoint(s=149.0221751025422, t=0.1829895305949371, h=0)), under_this_agent_control=True, neighborhood_vehicle_states=None, waypoint_paths=[[Waypoint(pos=array([162.93476966,  89.86449885]), heading=Heading(1.559602764469837), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=171.13226464295616), Waypoint(pos=array([161.83379489,  89.87682319]), heading=Heading(1.747027881032307), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=172.07056876998743), Waypoint(pos=array([160.75328482,  89.69803419]), heading=Heading(1.8500277774107177), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=173.12966362278578), Waypoint(pos=array([159.67988185,  89.45287425]), heading=Heading(1.9237080016040862), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=174.230707368045), Waypoint(pos=array([158.60647889,  89.20771431]), heading=Heading(1.9973882257974545), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=175.33175111330416), Waypoint(pos=array([157.59134996,  88.79555827]), heading=Heading(2.050494480806548), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=176.43279485856337), Waypoint(pos=array([156.59845877,  88.3196755 ]), heading=Heading(2.095749585910659), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=177.53383860382257), Waypoint(pos=array([155.60556757,  87.84379274]), heading=Heading(2.1410046910147704), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=178.63488234908178), Waypoint(pos=array([154.63977259,  87.32101833]), heading=Heading(2.1950174304832806), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=179.73592609434098), Waypoint(pos=array([153.73166421,  86.69841372]), heading=Heading(2.2676747756296716), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=180.8369698396002), Waypoint(pos=array([152.82355583,  86.07580911]), heading=Heading(2.340332120776063), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=181.93801358485942), Waypoint(pos=array([151.97761121,  85.38038388]), heading=Heading(2.432985636363633), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=183.03905733011862), Waypoint(pos=array([151.22021981,  84.58122458]), heading=Heading(2.554124002256534), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=184.14010107537783), Waypoint(pos=array([150.46282841,  83.78206527]), heading=Heading(2.6752623681494345), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=185.24114482063703), Waypoint(pos=array([149.70543701,  82.98290596]), heading=Heading(2.7964007340423356), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=186.34218856589624), Waypoint(pos=array([149.28255538,  81.98275365]), heading=Heading(2.850717337031827), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=187.44323231115544), Waypoint(pos=array([148.93251671,  80.93883303]), heading=Heading(2.890482808872727), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=188.54427605641465), Waypoint(pos=array([148.58247805,  79.89491241]), heading=Heading(2.9302482807136276), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=189.64531980167385), Waypoint(pos=array([148.31339219,  78.82951344]), heading=Heading(3.00166879289681), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=190.74636354693305), Waypoint(pos=array([148.09987563,  77.74937085]), heading=Heading(3.094818612285991), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=191.84740729219226), Waypoint(pos=array([147.88635908,  76.66922826]), heading=Heading(-3.0952168755044145), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=192.94845103745146), Waypoint(pos=array([147.80554132,  75.58286707]), heading=Heading(-3.0143832722545616), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=194.04949478271067), Waypoint(pos=array([147.91710747,  74.48749028]), heading=Heading(-2.9514054588365375), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=195.15053852796987), Waypoint(pos=array([148.02867363,  73.39211348]), heading=Heading(-2.888427645418513), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=196.25158227322908), Waypoint(pos=array([148.23072581,  72.31457495]), heading=Heading(-2.8258782257614063), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=197.3526260184883), Waypoint(pos=array([148.54323191,  71.25881112]), heading=Heading(-2.7638517350428935), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=198.4536697637475), Waypoint(pos=array([148.855738  ,  70.20304729]), heading=Heading(-2.7018252443243806), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=199.55471350900672), Waypoint(pos=array([149.1682441 ,  69.14728346]), heading=Heading(-2.639798753605868), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=200.65575725426592), Waypoint(pos=array([149.68124112,  68.1757994 ]), heading=Heading(-2.722109737185413), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=201.75680099952513), Waypoint(pos=array([150.21691585,  67.2138483 ]), heading=Heading(-2.820746860394618), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=202.85784474478433), Waypoint(pos=array([150.68653327,  66.22571507]), heading=Heading(-2.9289367632432697), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=203.95888849004353), Waypoint(pos=array([150.9553321 ,  65.15798639]), heading=Heading(-3.0661677500823856), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=205.05993223530274), Waypoint(pos=array([151.04278976,  64.06197322]), heading=Heading(-3.0787615574906253), lane_id='445633931_0', lane_width=3.2, speed_limit=16.67, lane_index=0, lane_offset=206.16097598056194)], [Waypoint(pos=array([162.90383691,  86.66719364]), heading=Heading(1.5581654196012684), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=159.61381716498425), Waypoint(pos=array([161.78390606,  86.65558155]), heading=Heading(1.806351741263825), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=161.09787436761667), Waypoint(pos=array([160.68972756,  86.40374682]), heading=Heading(1.902639552887265), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=162.22065989245655), Waypoint(pos=array([159.59554905,  86.15191208]), heading=Heading(1.9989273645107053), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=163.34344541729646), Waypoint(pos=array([158.56661412,  85.71392057]), heading=Heading(2.062134241578217), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=164.46623094213635), Waypoint(pos=array([157.5546204 ,  85.22759143]), heading=Heading(2.116751295419949), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=165.58901646697623), Waypoint(pos=array([156.54262667,  84.74126229]), heading=Heading(2.1713683492616815), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=166.71180199181615), Waypoint(pos=array([155.61618192,  84.10701354]), heading=Heading(2.26194248330315), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=167.83458751665603), Waypoint(pos=array([154.68995979,  83.47237986]), heading=Heading(2.3526101883153068), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=168.9573730414959), Waypoint(pos=array([153.86608066,  82.7178151 ]), heading=Heading(2.494598994769428), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=170.08015856633583), Waypoint(pos=array([153.09367671,  81.90292893]), heading=Heading(2.6624006365451502), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=171.2029440911757), Waypoint(pos=array([152.35281033,  81.06907837]), heading=Heading(2.8215918047567925), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=172.3257296160156), Waypoint(pos=array([151.99520104,  80.00476501]), heading=Heading(2.876145084601586), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=173.4485151408555), Waypoint(pos=array([151.63759175,  78.94045165]), heading=Heading(2.9306983644463793), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=174.5713006656954), Waypoint(pos=array([151.38100733,  77.8492551 ]), heading=Heading(3.031406677905705), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=175.6940861905353), Waypoint(pos=array([151.16234032,  76.74796854]), heading=Heading(-3.1337470585647633), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=176.81687171537519), Waypoint(pos=array([151.01395381,  75.64333637]), heading=Heading(-3.022629715210885), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=177.93965724021507), Waypoint(pos=array([151.1270184 ,  74.52625816]), heading=Heading(-2.937234054173277), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=179.06244276505498), Waypoint(pos=array([151.24023545,  73.4092101 ]), heading=Heading(-2.851846451649476), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=180.18522828989487), Waypoint(pos=array([151.56096661,  72.33320878]), heading=Heading(-2.777428152183445), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=181.30801381473478), Waypoint(pos=array([151.88169778,  71.25720745]), heading=Heading(-2.7030098527174133), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=182.43079933957466), Waypoint(pos=array([152.22497121,  70.19067271]), heading=Heading(-2.6459494681899653), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=183.55358486441457), Waypoint(pos=array([152.76865157,  69.20829855]), heading=Heading(-2.7432057175912297), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=184.67637038925446), Waypoint(pos=array([153.31233193,  68.22592438]), heading=Heading(-2.840461966992494), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=185.79915591409437), Waypoint(pos=array([153.73873955,  67.19728218]), heading=Heading(-2.9363391416895706), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=186.92194143893428), Waypoint(pos=array([154.01226921,  66.10832448]), heading=Heading(-3.030418540240594), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=188.04472696377417), Waypoint(pos=array([154.18554097,  65.00370652]), heading=Heading(-3.1049395237379174), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=189.16751248861405), Waypoint(pos=array([154.25712854,  63.88320549]), heading=Heading(3.1235614611897944), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=190.29029801345396), Waypoint(pos=array([154.3287161 ,  62.76270446]), heading=Heading(3.06887713893792), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=191.41308353829385), Waypoint(pos=array([154.34444346,  61.6435468 ]), heading=Heading(2.989479161425937), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=192.53586906313373), Waypoint(pos=array([154.21907666,  60.52778226]), heading=Heading(2.8476583534768567), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=193.65865458797364), Waypoint(pos=array([154.09370986,  59.41201772]), heading=Heading(2.705837545527776), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=194.78144011281356), Waypoint(pos=array([153.64389634,  58.39010356]), heading=Heading(2.6903283125068675), lane_id='445633931_1', lane_width=3.2, speed_limit=16.67, lane_index=1, lane_offset=195.90422563765344)], [Waypoint(pos=array([162.86380213,  83.47081446]), heading=Heading(1.556304587729396), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=148.58582641410462), Waypoint(pos=array([161.85129199,  83.3916348 ]), heading=Heading(1.846374197811416), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=150.04492445549317), Waypoint(pos=array([160.85529652,  83.15923585]), heading=Heading(1.9682632052318068), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=151.06767380844417), Waypoint(pos=array([159.90218836,  82.80535403]), heading=Heading(2.055208510429958), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=152.09042316139514), Waypoint(pos=array([158.9810407 ,  82.36094069]), heading=Heading(2.116113054617784), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=153.11317251434613), Waypoint(pos=array([158.06744363,  81.9034882 ]), heading=Heading(2.1814651576000634), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=154.13592186729713), Waypoint(pos=array([157.2234844 ,  81.32577801]), heading=Heading(2.2878363124780194), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=155.1586712202481), Waypoint(pos=array([156.39456186,  80.73043634]), heading=Heading(2.408344787875904), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=156.1814205731991), Waypoint(pos=array([155.69086655,  79.98825769]), heading=Heading(2.646590438760664), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=157.2041699261501), Waypoint(pos=array([155.09575139,  79.1806814 ]), heading=Heading(2.8381052557547934), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=158.22691927910105), Waypoint(pos=array([154.76876471,  78.21161177]), heading=Heading(2.914222671973929), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=159.24966863205205), Waypoint(pos=array([154.5184082 ,  77.22204102]), heading=Heading(3.030198454082478), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=160.27241798500302), Waypoint(pos=array([154.31783055,  76.21915276]), heading=Heading(-3.111119134753571), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=161.295167337954), Waypoint(pos=array([154.27213094,  75.20869061]), heading=Heading(-2.982772829394536), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=162.31791669090498), Waypoint(pos=array([154.3738983 ,  74.19101697]), heading=Heading(-2.8673009247833923), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=163.34066604385598), Waypoint(pos=array([154.63829725,  73.20565314]), heading=Heading(-2.7793672414425576), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=164.36341539680697), Waypoint(pos=array([154.93326438,  72.22636226]), heading=Heading(-2.696609634996465), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=165.38616474975794), Waypoint(pos=array([155.28747072,  71.27196201]), heading=Heading(-2.664231187762655), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=166.40891410270893), Waypoint(pos=array([155.78048068,  70.3758831 ]), heading=Heading(-2.749896355760795), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=167.43166345565993), Waypoint(pos=array([156.27349064,  69.47980418]), heading=Heading(-2.835561523758935), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=168.45441280861093), Waypoint(pos=array([156.69395892,  68.55522087]), heading=Heading(-2.914928097732077), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=169.4771621615619), Waypoint(pos=array([156.94284859,  67.56321776]), heading=Heading(-2.9793969724856164), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=170.4999115145129), Waypoint(pos=array([157.19173826,  66.57121465]), heading=Heading(-3.043865847239156), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=171.52266086746386), Waypoint(pos=array([157.35195167,  65.56534079]), heading=Heading(-3.097891848341115), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=172.54541022041485), Waypoint(pos=array([157.41787704,  64.54471839]), heading=Heading(-3.140814109593517), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=173.56815957336585), Waypoint(pos=array([157.48380241,  63.52409599]), heading=Heading(3.0994489363336672), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=174.5909089263168), Waypoint(pos=array([157.54972778,  62.50347359]), heading=Heading(3.056526675081265), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=175.6136582792678), Waypoint(pos=array([157.54580209,  61.48448539]), heading=Heading(2.991640275159621), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=176.6364076322188), Waypoint(pos=array([157.43221904,  60.46806268]), heading=Heading(2.8922729450942923), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=177.65915698516977), Waypoint(pos=array([157.31863598,  59.45163997]), heading=Heading(2.7929056150289635), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=178.68190633812077), Waypoint(pos=array([157.20505293,  58.43521725]), heading=Heading(2.6935382849636347), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=179.70465569107176), Waypoint(pos=array([156.77275314,  57.51109218]), heading=Heading(2.689117764027726), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=180.72740504402273), Waypoint(pos=array([156.32561459,  56.59126429]), heading=Heading(2.689117764027726), lane_id='445633931_2', lane_width=3.2, speed_limit=16.67, lane_index=2, lane_offset=181.75015439697373)]], distance_travelled=0.0, lidar_point_cloud=None, drivable_area_grid_map=None, occupancy_grid_map=None, top_down_rgb=None, road_waypoints=None, via_data=Vias(near_via_points=[], hit_via_points=[]), signals=None)}
Adaickalavan commented 1 year ago

Hi @98luobo,

In multiagent scenarios, the agents may start and end at different time points in the simulation. Consider the following multiagent scenario with 3 agents.

Time (s) 0-10 11-20 21-30 31-40
Active agents Agent_1, Agent_2 Agent_1 None Agent_0
Observation.keys() Agent_1, Agent_2 Agent_1 None Agent_0

In this example above, Agent_1 and Agent_2 start at time 0s, whereas Agent_0 starts at time 31s. Agent_2 becomes done at time 10s, Agent_1 becomes done at time 20s, and Agent_0 becomes done at time 40s. There could also be periods of time when there are no agents such as between time 21s and time 30s. Since both Agent_1 and Agent_2 are done by time 20s, the observation returned by SMARTS for time 21s to 30s will be an empty dictionary, although the environment has not ended yet as Agent_0 is yet to become done.

In your last example above I believe at the first time point only Agent_0, Agent_1, and Agent_3 had spawned. Agent_2 will spawn soon after in subsequent time steps.

I hope this clarifies and let us know whether it addresses your issues.

98luobo commented 1 year ago

I think you're right, there are delayed generation agents in SMARTS, but I would probably prefer them to be generated simultaneously at t=0, because the purpose of our algorithm is to explore the cooperative relationship between agents.

Adaickalavan commented 1 year ago

Hi @98luobo,

We see two options here:

  1. Simply step the scenario until all egos spawn.

  2. We introduce new entry tactic to ensure egos spawn at the same time, but this entry tactic will make the spawning of egos unsafe (for example, the egos may have little room to move or collide in the very next step). Kindly let us know if you would like this option.

fahmyadan commented 1 year ago

I am experiencing an error quite similar to @98luobo using the ePyMARL library.

I've created a new environment that i've added to the registry. The simulation starts up fine and steps for a few episodes. For some reason, it will crash at random intervals with the following error message:

[ERROR 19:31:37] SMARTS Simulation crashed with exception. Attempting to cleanly shutdown.
[ERROR 19:31:37] SMARTS connection closed by SUMO
Traceback (most recent call last):
  File "/xxx/Experiments/SMARTS/smarts/core/smarts.py", line 215, in step
    return self._step(agent_actions, time_delta_since_last_step)
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 270, in _step
    provider_state = self._step_providers(all_agent_actions)
  File "/home/xxxSMARTS/smarts/core/smarts.py", line 1102, in _step_providers
    provider_state = self._handle_provider(provider, provider_error)
  File "/home/vxxx/SMARTS/smarts/core/smarts.py", line 1027, in _handle_provider
    self._scenario, self.elapsed_sim_time, provider_error
  File "/home/xxx/SMARTS/smarts/core/sumo_traffic_simulation.py", line 390, in recover
    raise error
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 1100, in _step_providers
    provider_state = self._step_provider(provider, actions)
  File "/xxxSMARTS/smarts/core/smarts.py", line 1141, in _step_provider
    provider_actions, self._last_dt, self._elapsed_sim_time
  File "/home/fxxxSMARTS/smarts/core/sumo_traffic_simulation.py", line 402, in step
    return self._step(dt)
  File "/home/xxx/SMARTS/smarts/core/sumo_traffic_simulation.py", line 407, in _step
    self._traci_conn.simulationStep(self._cumulative_sim_seconds)
  File "/home/fxxxSMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 315, in simulationStep
    result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step)
  File "/home/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 181, in _sendCmd
    return self._sendExact()
  File "/home/fxxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 91, in _sendExact
    raise FatalTraCIError("connection closed by SUMO")
sumo.tools.traci.exceptions.FatalTraCIError: connection closed by SUMO
[ERROR 19:31:37] pymarl Failed after 0:00:53!
Traceback (most recent calls WITHOUT Sacred internals):
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 215, in step
    return self._step(agent_actions, time_delta_since_last_step)
  File "/home/xxx/SMARTS/smarts/core/smarts.py", line 270, in _step
    provider_state = self._step_providers(all_agent_actions)
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 1102, in _step_providers
    provider_state = self._handle_provider(provider, provider_error)
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 1027, in _handle_provider
    self._scenario, self.elapsed_sim_time, provider_error
  File "/home/fxxx/SMARTS/smarts/core/sumo_traffic_simulation.py", line 390, in recover
    raise error
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 1100, in _step_providers
    provider_state = self._step_provider(provider, actions)
  File "/home/fxxx/SMARTS/smarts/core/smarts.py", line 1141, in _step_provider
    provider_actions, self._last_dt, self._elapsed_sim_time
  File "/home/fxxx/SMARTS/smarts/core/sumo_traffic_simulation.py", line 402, in step
    return self._step(dt)
  File "/xxx/SMARTS/smarts/core/sumo_traffic_simulation.py", line 407, in _step
    self._traci_conn.simulationStep(self._cumulative_sim_seconds)
  File "/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 315, in simulationStep
    result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step)
  File "/home/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 181, in _sendCmd
    return self._sendExact()
  File "/home/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 91, in _sendExact
    raise FatalTraCIError("connection closed by SUMO")
sumo.tools.traci.exceptions.FatalTraCIError: connection closed by SUMO

During handling of the above exception, another exception occurred:

Traceback (most recent calls WITHOUT Sacred internals):
  File "/xxx/SMARTS/.test/lib/python3.7/site-packages/wrapt/wrappers.py", line 523, in __call__
    args, kwargs)
  File "rl/main_epy.py", line 47, in my_main
    run(_run, config, _log)
  File "/xxx/SMARTS/rl/epymarl/src/run.py", line 64, in run
    run_sequential(args=args, logger=logger)
  File "/home/fahmy/PhD/Experiments/SMARTS/rl/epymarl/src/run.py", line 226, in run_sequential
    runner.run(test_mode=True)
  File "/xxx/SMARTS/rl/epymarl/src/runners/episode_runner.py", line 107, in run
    _, reward, terminated, env_info = self.env.step(actions[0])
  File "/xxxSMARTS/smarts/env/intersection_class.py", line 200, in step
    observations, rewards, dones, extras = self._smarts.step(agent_actions)
  File "/xxxSMARTS/smarts/core/smarts.py", line 226, in step
    self.destroy()
  File "/xxx/SMARTS/smarts/core/smarts.py", line 681, in destroy
    self.teardown()
  File "/xxx/smarts/core/smarts.py", line 664, in teardown
    self._traffic_sim.teardown()
  File "/home/xxx/smarts/core/sumo_traffic_simulation.py", line 358, in teardown
    self._remove_vehicles()
  File "/home/xxx/SMARTS/smarts/core/sumo_traffic_simulation.py", line 345, in _remove_vehicles
    self._traci_conn.vehicle.remove(vehicle_id)
  File "/home/fahmy/PhD/Experiments/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/_vehicle.py", line 1593, in remove
    self._setCmd(tc.REMOVE, vehID, "b", reason)
  File "/home/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/domain.py", line 189, in _setCmd
    self._connection._sendCmd(self._cmdSetID, varID, objectID, format, *values)
  File "/home/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 181, in _sendCmd
    return self._sendExact()
  File "/home/xxx/SMARTS/.test/lib/python3.7/site-packages/sumo/tools/traci/connection.py", line 82, in _sendExact
    if self._socket is None:
AttributeError: 'Connection' object has no attribute '_socket'

Exception ignored in: <function SMARTS.__del__ at 0x7f10f37abb90>
Traceback (most recent call last):
  File "/home/fahmy/PhD/Experiments/SMARTS/smarts/core/smarts.py", line 720, in __del__
    e,
smarts.core.smarts.SMARTSDestroyedError: ('ERROR: A SMARTS instance may have been deleted by gc before a call to destroy. Please explicitly call `del obj` or `SMARTS.destroy()` to make this error go away.', AttributeError("'Connection' object has no attribute '_socket'"))
/usr/lib/python3.7/subprocess.py:883: ResourceWarning: subprocess 67190 is still running
  ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name=40>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=41>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name=43>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Killed
Adaickalavan commented 1 year ago

Hi @fahmyadan,

fahmyadan commented 1 year ago

Sure!

Adaickalavan commented 1 year ago

In multiagent scenario simulations, the agents start time points may be specified by the user in the corresponding scenario.py file. The exact time and location of agent spawning is ultimately controlled by the underlying simulator for optimum vehicle placement.

We hope the above addresses the original issue of this thread and thus this issue is being closed. Please feel free to open a new issue for other questions.

98luobo commented 1 year ago

@Adaickalavan Sorry for the delay in reply due to work last week. I hope to obtain the second method of "simultaneous generation of ego" you mentioned, because I am exploring the emergency cooperative driving strategy of vehicles in critical moments. Collision is acceptable, and we want to ensure that the impact of collision or loss of control on traffic and drivers is minimized by training the strategy of ego!