huawei-noah / SMARTS

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

Update examples #2079

Closed Gamenot closed 1 year ago

Gamenot commented 1 year ago

This example can be run like this:

$ python examples/6_experiment_base.py +experiment=standard_lane_follower +env_config/scenarios=intersections episodes=2
Loading configuration from `/home/mtuck/repos/SMARTS/examples/configs/6_experiment_base`

# Current used configuration
# ==========================

episodes: 2
show_config: true
minimum_steps: 1
agent_configs:
  agent_j:
    locator: __main__:standard_lane_follower-v0
    max_episode_steps: 1000
  agent_k:
    locator: __main__:standard_lane_follower-v0
    max_episode_steps: 1000
env_config:
  id: smarts.env:hiway-v1
  scenarios:
  - ./scenarios/sumo/intersections/2lane
  - ./scenarios/sumo/intersections/2lane_circle
  - ./scenarios/sumo/intersections/4lane
  - ./scenarios/sumo/intersections/4lane_t
  - ./scenarios/sumo/intersections/6lane
  agent_interfaces: {}
  sim_name: null
  scenarios_order: scrambled
  headless: true
  visdom: false
  fixed_timestep_sec: 0.1
  sumo_options:
    num_external_clients: 0
    auto_start: true
    headless: true
    port: null
  seed: 42
  observation_options: multi_agent
  action_options: multi_agent
  environment_return_mode: per_agent

# ==========================
[2023-07-21 20:37:23,425][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/2lane/.
[2023-07-21 20:37:23,426][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/2lane_circle/.
[2023-07-21 20:37:23,428][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/4lane/.
[2023-07-21 20:37:23,430][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/4lane_t/.
[2023-07-21 20:37:23,431][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/6lane/.
[2023-07-21 20:37:24,220][smarts.core.configuration][INFO] - Using engine configuration from: /home/mtuck/repos/SMARTS/smarts/engine.ini
╭────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────╮
│            Episode │     Sim T / Wall T │        Total Steps │        Steps / Sec │       Scenario Map │    Scenario Routes │     Mission (Hash) │             Scores │
├────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┤
│                1/2 │               3.86 │                 17 │              38.60 │       2lane_circle │                    │ 204454654383367451 │     6.85 - agent_k │
│                    │                    │                    │                    │                    │                    │                    │    41.65 - agent_j │
│                2/2 │               4.71 │                 16 │              47.12 │       2lane_circle │                    │ 204454654383367451 │    24.42 - agent_k │
│                    │                    │                    │                    │                    │                    │                    │    33.07 - agent_j │
╰────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────╯

I think this might require some experiment engineering but I have set up the basics for creating an experiment.

Gamenot commented 1 year ago

The end understanding is that this will be implemented for experiments