Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation fixes. #1800

Merged
merged 3,062 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3062 commits
Select commit Hold shift + click to select a range
111d9c5
added changedlog.
AisenGinn Nov 21, 2022
43c4a3b
deleted unwanted file.
AisenGinn Nov 21, 2022
6b4ddf3
modified workflows.
AisenGinn Nov 21, 2022
a543bb8
GitHub Actions: Update requirements.txt
AisenGinn Nov 21, 2022
6c3a0ef
GitHub Actions: Format
AisenGinn Nov 21, 2022
b30cf41
moved import gif_recorder inside start_recording function to pass the…
AisenGinn Nov 21, 2022
741cc6c
revert changing.
AisenGinn Nov 21, 2022
d302972
Merge pull request #1499 from AisenGinn/develop
Gamenot Nov 21, 2022
620ded6
GitHub Actions: Update requirements.txt
Gamenot Nov 21, 2022
13074cc
Remove a duplicate traffic light subscription call
Gamenot Nov 16, 2022
26b5ce5
fetch develop
AisenGinn Nov 22, 2022
e4152ee
Merge branch 'develop' of https://github.com/huawei-noah/SMARTS into …
AisenGinn Nov 22, 2022
cc407e4
modified changelog.
AisenGinn Nov 22, 2022
4a92a92
modified changelog.
AisenGinn Nov 22, 2022
1148e96
Remove case that caused external PRs to fail.
Gamenot Nov 22, 2022
6e4d571
GitHub Actions: Update requirements.txt
Gamenot Nov 23, 2022
80f2021
Merge branch 'develop' into bubble_shape_new
Gamenot Nov 23, 2022
84a99b1
Merge branch 'develop' of https://github.com/huawei-noah/SMARTS into …
AisenGinn Nov 23, 2022
7e24d3d
added detail description of bubble that does not have a valid closed …
AisenGinn Nov 23, 2022
87d438d
Merge branch 'bubble_shape_new' of https://github.com/AisenGinn/SMART…
AisenGinn Nov 23, 2022
4688ba3
Merge pull request #1693 from AisenGinn/bubble_shape_new
Gamenot Nov 23, 2022
942d8ef
GitHub Actions: Update requirements.txt
Gamenot Nov 23, 2022
f7ad0f0
GitHub Actions: Format
Gamenot Nov 23, 2022
ad32c10
update branch from develop
AisenGinn Nov 24, 2022
e4d6b25
Pat/benchmark (#1718)
qianyi-sun Nov 24, 2022
9d46a48
GitHub Actions: Update requirements.txt
qianyi-sun Nov 24, 2022
a354a66
GitHub Actions: Format
qianyi-sun Nov 24, 2022
8823c60
GitHub Actions: Update cli.rst
qianyi-sun Nov 24, 2022
80174ba
slightly modified bubble_manager & single_agent.
AisenGinn Nov 24, 2022
5948c69
Restore buddha action space
Gamenot Nov 24, 2022
661e299
Expose glb file metadata. (#1716)
Gamenot Nov 25, 2022
228b8fd
GitHub Actions: Update requirements.txt
Gamenot Nov 25, 2022
56d64c5
modified radius.
AisenGinn Nov 28, 2022
285fc18
Convert `-` to `_` in options.extras_require (#1756)
Adaickalavan Nov 28, 2022
d28758c
Upgrade SUMO to 1.12.0 (#1751)
saulfield Nov 28, 2022
7bf175f
GitHub Actions: Update requirements.txt
saulfield Nov 28, 2022
d992f97
Update of rl example: racing (#1752)
Adaickalavan Nov 28, 2022
1cfaee6
Remove Ultra (#1755)
Adaickalavan Nov 28, 2022
f940b7f
Merge pull request #1708 from AisenGinn/bubble_distance_check
Gamenot Nov 28, 2022
292acd3
GitHub Actions: Update mac_requirements.txt
Gamenot Nov 28, 2022
9e25652
Envision: "All Simulation" Button (#1761)
qianyi-sun Nov 30, 2022
f586f33
GitHub Actions: Update requirements.txt
qianyi-sun Nov 30, 2022
f90705a
GitHub Actions: Update mac_requirements.txt
Gamenot Dec 5, 2022
9904e94
Speed up rllib test (#1767)
Gamenot Dec 6, 2022
04dcdfa
GitHub Actions: Update requirements.txt
Gamenot Dec 6, 2022
dbb44fc
GitHub Actions: Format
Gamenot Dec 6, 2022
9c823a5
Fix Envision visualization issue in "near real time" mode (#1766)
qianyi-sun Dec 6, 2022
3d7a1ae
GitHub Actions: Format
qianyi-sun Dec 6, 2022
82a05a7
Test rllibhiwayenv directly (#1769)
Gamenot Dec 8, 2022
280d478
GitHub Actions: Update requirements.txt
Gamenot Dec 8, 2022
3e1ec42
GitHub Actions: Update mac_requirements.txt
Gamenot Dec 12, 2022
f85dfb8
Updated use of shapely.geometry.Polygon and shapely.geometry.collecti…
Adaickalavan Dec 14, 2022
a142b6e
GitHub Actions: Update requirements.txt
Adaickalavan Dec 14, 2022
98706f9
GitHub Actions: Format
Adaickalavan Dec 14, 2022
44012d8
Suppress TraCI Error on simulationStep (#1770)
saulfield Dec 14, 2022
46acf1a
Performance metrics (#1753)
Adaickalavan Dec 14, 2022
67d58a7
Suppress the `DeprecationWarning` caused by the `trimesh` package (#1…
qianyi-sun Dec 16, 2022
5fe0964
Scenario Caching (#1764)
saulfield Dec 16, 2022
2872a54
GitHub Actions: Format
saulfield Dec 16, 2022
b8bf14f
GitHub Actions: Update cli.rst
saulfield Dec 16, 2022
3b3138d
GitHub Actions: Update mac_requirements.txt
Gamenot Dec 19, 2022
9aea454
rename all occurrences from `benchmark` to `diagnostic` (#1780)
qianyi-sun Dec 21, 2022
e52bfc8
GitHub Actions: Update requirements.txt
qianyi-sun Dec 21, 2022
237c29a
GitHub Actions: Update cli.rst
qianyi-sun Dec 21, 2022
57e8ba8
Fix `open-agent` setup error. (#1785)
Gamenot Dec 23, 2022
bdc1eb6
GitHub Actions: Update requirements.txt
Gamenot Dec 23, 2022
b5e2a86
Reorganize examples (#1784)
Adaickalavan Dec 23, 2022
491acb2
Removed trainer folder. (#1787)
Adaickalavan Dec 23, 2022
376bceb
Fix issues preventing minicity from working. (#1788)
Gamenot Dec 24, 2022
9e11f51
GitHub Actions: Update requirements.txt
Gamenot Dec 24, 2022
464de43
GitHub Actions: Update mac_requirements.txt
Gamenot Dec 26, 2022
a054332
Remove observation_adapter, action_adapter, reward_adapter, and info_…
Adaickalavan Dec 28, 2022
3754e9f
GitHub Actions: Update requirements.txt
Adaickalavan Dec 28, 2022
1b8d5b5
Move dataset generator tool (#1782)
Adaickalavan Dec 29, 2022
8891106
GitHub Actions: Update requirements.txt
Adaickalavan Dec 29, 2022
4d94867
GitHub Actions: Update mac_requirements.txt
Gamenot Jan 2, 2023
14149b5
Performance metrics - normalized, recomputed, overall score (#1772)
Adaickalavan Jan 5, 2023
31d3e8f
GitHub Actions: Update requirements.txt
Adaickalavan Jan 5, 2023
2c89263
Encapsulate traci connection utility.
Gamenot Dec 14, 2022
bdf7566
Retry connection persistently if process is alive.
Gamenot Dec 14, 2022
17fd99a
Update CHANGELOG.md
Gamenot Dec 14, 2022
be6c93e
Fix doctest.
Gamenot Dec 14, 2022
2654227
Fix for python3.7
Gamenot Dec 14, 2022
2b56a6f
Make format.
Gamenot Dec 14, 2022
e43b27f
Fix case where traci_conn is not set up.
Gamenot Dec 14, 2022
181b054
Fix error where sumo process is None.
Gamenot Dec 15, 2022
1fbd0b6
Clean up sumo traffic simulation class.
Gamenot Dec 15, 2022
69f2f97
Fix route finding bug.
Gamenot Dec 19, 2022
a60116c
Attempt another fix at connection
Gamenot Dec 19, 2022
310628c
Optimize connection check.
Gamenot Dec 19, 2022
603db5e
Fix formatting
Gamenot Dec 20, 2022
f8ad21b
Support up to SUMO 1.15.0
Gamenot Dec 20, 2022
99444ea
Update changelog.
Gamenot Dec 20, 2022
2579d55
Fix type errors
Gamenot Dec 21, 2022
9f0c8a9
Loosen sumo version
Gamenot Dec 21, 2022
4e492c5
Fix minimum sumo version
Gamenot Dec 21, 2022
89babdc
Remove SUMO home test.
Gamenot Dec 22, 2022
529933d
Use partition instead of split to prevent errors.
Gamenot Dec 22, 2022
479d2f1
Update CHANGELOG.md
Gamenot Dec 28, 2022
949ae1a
Update CHANGELOG.md
Gamenot Dec 28, 2022
9d1d960
Update CHANGELOG.md
Gamenot Dec 28, 2022
a0fa12e
Fix issues that occur when exceptions are thrown
Gamenot Dec 29, 2022
eee9d3e
Move sleep out of utility.
Gamenot Dec 29, 2022
ea346f8
Raise exception still.
Gamenot Dec 30, 2022
3286b94
Try optimization
Gamenot Dec 30, 2022
d510122
Improve the code quality.
Gamenot Dec 30, 2022
2cc0f75
GitHub Actions: Update requirements.txt
Gamenot Jan 5, 2023
6558768
Envision map fix (#1790)
saulfield Jan 5, 2023
e8bab4c
GitHub Actions: Update mac_requirements.txt
Gamenot Jan 9, 2023
94f72fa
CI test for performance metrics (#1778)
Adaickalavan Jan 13, 2023
754ebf2
GitHub Actions: Update requirements.txt
Adaickalavan Jan 13, 2023
ca1e5fd
GitHub Actions: Format
Adaickalavan Jan 13, 2023
d3d11e6
Fix notebook env
Gamenot Oct 11, 2022
5127862
Revert "Remove unused utility."
Gamenot Oct 11, 2022
c2b0b83
Add local version
Gamenot Oct 13, 2022
7caed9d
Update error with more information
Gamenot Oct 17, 2022
cab6cc1
Delete create_run_visualize.py
Gamenot Nov 16, 2022
97e35b5
GitHub Actions: Update requirements.txt
Gamenot Jan 16, 2023
2e51118
GitHub Actions: Format
Gamenot Jan 16, 2023
368ad92
GitHub Actions: Update mac_requirements.txt
Gamenot Jan 16, 2023
cba794a
Add road lines to RGB image observations (#1796)
saulfield Jan 18, 2023
7fd2909
GitHub Actions: Update requirements.txt
saulfield Jan 18, 2023
e9778cf
GitHub Actions: Format
saulfield Jan 18, 2023
9d94323
Revamped documentation (#1792)
Adaickalavan Jan 20, 2023
23cd773
GitHub Actions: Update requirements.txt
Adaickalavan Jan 20, 2023
97a00df
GitHub Actions: Format
Adaickalavan Jan 20, 2023
66cceab
Add base environment
Gamenot Jan 9, 2023
fca2e29
Close to a working environment.
Gamenot Jan 9, 2023
0f2db62
Simplify format_obs changes.
Gamenot Jan 10, 2023
5507637
Update original environments to support upgrades.
Gamenot Jan 10, 2023
8d0d0ae
Update documentation.
Gamenot Jan 10, 2023
70d9beb
Use class instead of assignment.
Gamenot Jan 10, 2023
1515d71
Fix name of attribute.
Gamenot Jan 10, 2023
70de5f7
Update an example.
Gamenot Jan 10, 2023
5ccd6e4
Large update of variable names.
Gamenot Jan 11, 2023
8a292bb
Fix leftover warning.
Gamenot Jan 11, 2023
009fe93
Fix multi-line string.
Gamenot Jan 11, 2023
2d221d8
Restore format obs conversion.
Gamenot Jan 11, 2023
13513bb
Fix new action.
Gamenot Jan 13, 2023
7bc7e07
Add conversion utility.
Gamenot Jan 13, 2023
7cf5a9f
Add missing header.
Gamenot Jan 13, 2023
968e276
Add observation space to HiWayV1 and comp env.
Gamenot Jan 13, 2023
dac40a8
Update metrics.
Gamenot Jan 13, 2023
ea9a6c0
Update examples.
Gamenot Jan 13, 2023
59b4ae6
Add missing interface for road map route.
Gamenot Jan 13, 2023
e0aa773
Standardize observation formatter names.
Gamenot Jan 13, 2023
34ac0dc
Revert most format obs changes.
Gamenot Jan 13, 2023
f9f11ad
Move the gymnasium environments and utilities.
Gamenot Jan 13, 2023
73aeba9
Remove unused imports.
Gamenot Jan 13, 2023
954a547
Update test examples.
Gamenot Jan 13, 2023
b07188b
Fix string warning.
Gamenot Jan 13, 2023
5d6b6b7
Fix rewards return for hiway-v1.
Gamenot Jan 13, 2023
eb057ed
Fix gymnasium warnings.
Gamenot Jan 13, 2023
08f5c02
make format
Gamenot Jan 13, 2023
cb0d9dc
Update resource loading.
Gamenot Jan 13, 2023
9a024b3
Benchmark
Gamenot Jan 13, 2023
05f7f33
Add worker logging to benchmark.
Gamenot Jan 15, 2023
cd8d48c
Add observation space demo to benchmark.
Gamenot Jan 15, 2023
f67ce1c
Comment on necessary improvements to observations.
Gamenot Jan 15, 2023
5c2ed17
Update observations.
Gamenot Jan 15, 2023
3b89aea
Make format.
Gamenot Jan 15, 2023
4996ffb
Make goals immutable
Gamenot Jan 16, 2023
330eadd
Add module substitution utility.
Gamenot Jan 17, 2023
1e201d3
Add `scl benchmark` utilities.
Gamenot Jan 17, 2023
edfbb78
Remove template types in strings.
Gamenot Jan 17, 2023
c162cfa
Update Makefile
Gamenot Jan 17, 2023
40026d7
Apply suggestion that truncated is set if policy fails.
Gamenot Jan 17, 2023
48f7d65
Fix documentation for RelativeTargetPose.
Gamenot Jan 17, 2023
0150194
Add `Score` object for metrics.
Gamenot Jan 17, 2023
b2ceaa4
Revert package resources distribution version.
Gamenot Jan 17, 2023
ee8241e
Fix spelling error.
Gamenot Jan 17, 2023
c8498f2
Remove pylint error suppression.
Gamenot Jan 17, 2023
66c5944
Fix symantics error.
Gamenot Jan 17, 2023
a1b2192
Fix key changes in format obs test.
Gamenot Jan 17, 2023
273d3c7
Update test single agent keys.
Gamenot Jan 17, 2023
eb3e4f9
make format.
Gamenot Jan 17, 2023
076db5b
Add agent action type configuration and limit TargetPose.
Gamenot Jan 18, 2023
1b0d595
Fix key error in format obs test.
Gamenot Jan 18, 2023
1634d42
Fix rgb image test parameterization issue.
Gamenot Jan 18, 2023
94aea72
Hook up seed to the hiway-env environment.
Gamenot Jan 18, 2023
54ce994
Move action space resolution to competition env.
Gamenot Jan 18, 2023
63143b7
remove multi_scenario environment.
Gamenot Jan 18, 2023
b427f7b
Refactor out multiple inheritance from observation converters.
Gamenot Jan 18, 2023
48702c0
Configure hiway env observation space options.
Gamenot Jan 18, 2023
72bcfde
Update hiway env configuration.
Gamenot Jan 19, 2023
42bf624
Move agent config.
Gamenot Jan 19, 2023
ddc0769
Disable env check in gym registration.
Gamenot Jan 19, 2023
fab95b0
Remove redundant assignment.
Gamenot Jan 19, 2023
3baf000
Remove needless type check.
Gamenot Jan 19, 2023
b9d4a05
Fix dictionary unpack.
Gamenot Jan 19, 2023
9de9af2
Clearly warn that offroad causes completion penalties.
Gamenot Jan 19, 2023
6c7d237
Mention why completion was penalized.
Gamenot Jan 19, 2023
4e60ccc
Cache space value.
Gamenot Jan 19, 2023
ee8fd40
Set mission to old location in gym observations.
Gamenot Jan 19, 2023
fdccd56
Rename hiway env v1 example.
Gamenot Jan 19, 2023
32dda7e
Add an api adaptor for gymnasium to gym<=0.21.
Gamenot Jan 19, 2023
3f26597
Allow old gym wrappers to work with gymnasium.
Gamenot Jan 19, 2023
f32f1d8
Allow more wrappers to work with new gymnasium env.
Gamenot Jan 19, 2023
50efcfb
Make format
Gamenot Jan 19, 2023
affa032
Condense imports.
Gamenot Jan 19, 2023
9a27d1f
Constrain the relative target pose speed to 28mps.
Gamenot Jan 19, 2023
7100a3c
Remove EpisodeLimit wrapper.
Gamenot Jan 19, 2023
900b68f
Add missing sstudio import.
Gamenot Jan 19, 2023
75748df
Make relative target pose the default action.
Gamenot Jan 19, 2023
3b42f75
Clean up comments.
Gamenot Jan 19, 2023
5ef2f33
Update the action space docstring.
Gamenot Jan 19, 2023
273861c
Fix the speed cap for relative target pose.
Gamenot Jan 19, 2023
a373ded
Fix issues with rebase.
Gamenot Jan 20, 2023
248630f
Update hiway env v1 example.
Gamenot Jan 20, 2023
b750c8c
Fix rebase issues.
Gamenot Jan 20, 2023
52740b6
Renamed camera_pos to camera_position.
Gamenot Jan 20, 2023
1235287
Set api reversion to be a gym wrapper instead.
Gamenot Jan 20, 2023
7f7210a
Remove useless examples.
Gamenot Jan 20, 2023
1683004
Revert marl benchmark changes.
Gamenot Jan 20, 2023
70b1841
Fill out auto-install
Gamenot Jan 20, 2023
866b61d
Rename benchmark example agent.
Gamenot Jan 20, 2023
7de62f1
Document hiway env v1.
Gamenot Jan 20, 2023
456e9af
Fix test observations.
Gamenot Jan 20, 2023
0eff7d0
Remove useless docstring.
Gamenot Jan 20, 2023
e9898ca
Rename competition metrics back to metrics.
Gamenot Jan 20, 2023
9b247a0
Add hiway-env-v1 to the environment documentation.
Gamenot Jan 20, 2023
55938c8
Set dynamic number of cpus for benchmark runner.
Gamenot Jan 20, 2023
6ddfc98
Add error tolerance configuration.
Gamenot Jan 20, 2023
ed949f1
Make worker logging explicit.
Gamenot Jan 21, 2023
69530e2
Fix cpu affinity check
Gamenot Jan 21, 2023
0019be4
Add hiway_v1 to example tests.
Gamenot Jan 21, 2023
a189c33
Fix sanity-test
Gamenot Jan 21, 2023
d3ce602
Fix format obs.
Gamenot Jan 21, 2023
9fb7bd1
Update metrics test.
Gamenot Jan 21, 2023
857959a
Fix rgb image test.
Gamenot Jan 21, 2023
d57a99b
Finish writing docstrings and scl help.
Gamenot Jan 21, 2023
088ea36
Fix pytype complaint.
Gamenot Jan 21, 2023
05dd059
Make format.
Gamenot Jan 21, 2023
56a4bae
Revert rl racing example.
Gamenot Jan 21, 2023
56d14ca
Fix pytype.
Gamenot Jan 21, 2023
ee27d45
Fix sanity test
saulfield Jan 21, 2023
41ce30a
Merge branch 'develop' into tucker/feature-hiway_v1
Gamenot Jan 21, 2023
5989cfe
Fix issues with benchmark utility.
Gamenot Jan 22, 2023
9ffc90e
Fix pytype errors.
Gamenot Jan 22, 2023
46f3108
Fix docstring test.
Gamenot Jan 22, 2023
b839100
Touch up interface.
Gamenot Jan 22, 2023
a59c6c3
Allow leaving out benchmark version.
Gamenot Jan 22, 2023
ef6f5fb
Add benchmark documentation.
Gamenot Jan 22, 2023
2a8d1d0
Update changelog.
Gamenot Jan 22, 2023
9ef2cab
Merge pull request #1793 from huawei-noah/tucker/feature-hiway_v1
Gamenot Jan 22, 2023
af51fef
GitHub Actions: Update requirements.txt
Gamenot Jan 22, 2023
182f0d3
Update SMARTS version to 1.0.0
Gamenot Jan 22, 2023
da2ebde
Fix documentation errors.
Gamenot Jan 23, 2023
9f607c6
GitHub Actions: Update requirements.txt
Gamenot Jan 23, 2023
266e62a
Merge branch 'master' into develop
Gamenot Jan 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/sim/env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ HiwayEnvV1
``HiwayEnvV1`` inherits class ``gymnasium.Env`` and supports gym APIs like ``reset``, ``step``, ``close``. An usage example is shown below.
This version has two configurations of observation output: `ObservationOptions.full` which provides padded agents in the observations which
exactly matches the `env.observation_space`, and `ObservationOptions.multi_agent` which provides only agents as are currently active. Refer to
:class:`~smarts.env.gymnasium.hiway_env_v1.HiWayEnvV1` for more details.
:class:`~smarts.env.gymnasium.hiway_env_v1.HiWayEnvV1` for more details.

.. code-block:: python

Expand Down
4 changes: 2 additions & 2 deletions docs/sim/obs_action_reward.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ The complete set of possible :class:`~smarts.core.sensors.Observation` returned
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| steps_completed | int | Number of steps this agent has taken within SMARTS. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| elapsed_sim_time | float | Amount of simulation time elapsed for the current scenario. |
| elapsed_sim_time | float | Amount of simulation time elapsed for the current scenario. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| events | :class:`~smarts.core.events.Events` | Classified observations that can trigger agent done status. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| ego_vehicle_state | :class:`~smarts.core.sensors.EgoVehicleObservation` | Ego vehicle status. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| under_this_agent_control | bool | Whether this agent currently has control of the vehicle. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| neighborhood_vehicle_states | Optional[List[:class:`~smarts.core.sensors.VehicleObservation`]] | List of neighborhood vehicle states. |
| neighborhood_vehicle_states | Optional[List[:class:`~smarts.core.sensors.VehicleObservation`]] | List of neighborhood vehicle states. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
| waypoint_paths | Optional[List[List[:class:`~smarts.core.road_map.Waypoint`]]] | Dynamic evenly-spaced points on the road ahead of the vehicle. |
+------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Automat==22.10.0
beautifulsoup4==4.11.1
blessed==1.19.1
cached-property==1.5.2
cachetools==5.2.1
cachetools==5.3.0
certifi==2022.12.7
charset-normalizer==2.1.1
click==8.1.3
Expand Down Expand Up @@ -43,7 +43,7 @@ grpcio==1.51.1
gym==0.19.0
gymnasium==0.27.0
gymnasium-notices==0.0.1
h5py==3.7.0
h5py==3.8.0
hyperlink==21.0.0
idna==3.4
ijson==3.2.0.post0
Expand Down
70 changes: 44 additions & 26 deletions smarts/env/gymnasium/hiway_env_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,15 @@ class SumoOptions(NamedTuple):
)


# TODO: Could not help the double layer joke here: highway-lowway huawei-laowei. Add a real name.
class HiWayEnvV1(gym.Env):
"""A generic environment for various driving tasks simulated by SMARTS.

Args:
scenarios (Sequence[str]): A list of scenario directories that
scenarios (Sequence[str]): A list of scenario directories that
will be simulated.
agent_interfaces (Dict[str, AgentInterface]): Specification of the agents
needs that will be used to configure the environment.
sim_name (str, optional): Simulation name. Defaults to
None.
sim_name (str, optional): Simulation name. Defaults to None.
scenarios_order (ScenarioOrder, optional): Configures the order that
scenarios will provided over successive resets.
headless (bool, optional): If True, disables visualization in
Expand All @@ -119,14 +117,14 @@ class HiWayEnvV1(gym.Env):
zoo_addrs (str, optional): List of (ip, port) tuples of
zoo server, used to instantiate remote social agents. Defaults
to None.
observation_options (ObservationOptions | string): Defines the options
observation_options (ObservationOptions, string): Defines the options
for how the formatting matches the observation space. String version
can be used instead. See :class:`ObservationOptions`. Defaults to
`ObservationOptions.default`.
:attr:`ObservationOptions.default`.
"""

metadata = {"render.modes": ["human"]}
"""Metadata for gym's use"""
"""Metadata for gym's use."""

# define render_mode if your environment supports rendering
render_mode: Optional[str] = None
Expand Down Expand Up @@ -233,15 +231,20 @@ def step(
],
]:
"""Run one timestep of the environment's dynamics using the agent actions.

When the end of an episode is reached (``terminated or truncated``), it is necessary to call :meth:`reset` to
reset this environment's state for the next episode.

Args:
action (ActType): an action provided by the agent to update the environment state.

Returns:
observation (dict): An element of the environment's :attr:`observation_space` as the next observation due to the agent actions.
This observation will change based on the provided :attr:`agent_interfaces`. Check :attr:`observation_space after initialization.
reward (SupportsFloat): The reward as a result of taking the action.
observation (dict): An element of the environment's :attr:`observation_space` as the
next observation due to the agent actions. This observation will change based on
the provided :attr:`agent_interfaces`. Check :attr:` observation_space after
initialization.
reward (SupportsFloat): The reward as a result of taking the
action.
terminated (bool): Whether the agent reaches the terminal state (as defined under the MDP of the task)
which can be positive or negative. An example is reaching the goal state. If true, the user needs to call :meth:`reset`.
truncated (bool): Whether the truncation condition outside the scope of the MDP is satisfied.
Expand Down Expand Up @@ -320,10 +323,11 @@ def reset(
Usually, you want to pass an integer *right after the environment has been initialized and then never again*.
options (optional dict): Additional information to specify how the environment is reset (optional,
depending on the specific environment)

Returns:
observation (dict): Observation of the initial state. This will be an element of :attr:`observation_space`
and is analogous to the observation returned by :meth:`step`.
info (dictionary): This dictionary contains auxiliary information complementing ``observation``. It should be analogous to
info (dict): This dictionary contains auxiliary information complementing ``observation``. It should be analogous to
the ``info`` returned by :meth:`step`.
"""
super().reset(seed=seed, options=options)
Expand All @@ -347,20 +351,27 @@ def render(
The environment's :attr:`metadata` render modes (`env.metadata["render_modes"]`) should contain the possible
ways to implement the render modes. In addition, list versions for most render modes is achieved through
`gymnasium.make` which automatically applies a wrapper to collect rendered frames.

Note:
As the :attr:`render_mode` is known during ``__init__``, the objects used to render the environment state
should be initialised in ``__init__``.

By convention, if the :attr:`render_mode` is:
- None (default): no render is computed.
- "human": The environment is continuously rendered in the current display or terminal, usually for human consumption.
This rendering should occur during :meth:`step` and :meth:`render` doesn't need to be called. Returns ``None``.
- "rgb_array": Return a single frame representing the current state of the environment.
A frame is a ``np.ndarray`` with shape ``(x, y, 3)`` representing RGB values for an x-by-y pixel image.
- "ansi": Return a strings (``str``) or ``StringIO.StringIO`` containing a terminal-style text representation
for each time step. The text can include newlines and ANSI escape sequences (e.g. for colors).
- "rgb_array_list" and "ansi_list": List based version of render modes are possible (except Human) through the
wrapper, :py:class:`gymnasium.wrappers.RenderCollection` that is automatically applied during ``gymnasium.make(..., render_mode="rgb_array_list")``.
The frames collected are popped after :meth:`render` is called or :meth:`reset`.
- None (default): no render is computed.
- "human": The environment is continuously rendered in the current display or terminal,
usually for human consumption. This rendering should occur during :meth:`step` and
:meth:`render` doesn't need to be called. Returns ``None``.
- "rgb_array": Return a single frame representing the current state of the environment.
A frame is a ``np.ndarray`` with shape ``(x, y, 3)`` representing RGB values for
an x-by-y pixel image.
- "ansi": Return a strings (``str``) or ``StringIO.StringIO`` containing a
terminal-style text representation for each time step. The text can include
newlines and ANSI escape sequences (e.g. for colors).
- "rgb_array_list" and "ansi_list": List based version of render modes are possible
(except Human) through the wrapper, :py:class:`gymnasium.wrappers.RenderCollection`
that is automatically applied during ``gymnasium.make(..., render_mode="rgb_array_list")``.
The frames collected are popped after :meth:`render` is called or :meth:`reset`.

Note:
Make sure that your class's :attr:`metadata` ``"render_modes"`` key includes the list of supported modes.
"""
Expand All @@ -382,6 +393,7 @@ def close(self):
@property
def unwrapped(self) -> gym.Env[ObsType, ActType]:
"""Returns the base non-wrapped environment.

Returns:
Env: The base non-wrapped :class:`gymnasium.Env` instance
"""
Expand All @@ -390,8 +402,9 @@ def unwrapped(self) -> gym.Env[ObsType, ActType]:
@property
def np_random(self) -> np.random.Generator:
"""Returns the environment's internal :attr:`_np_random` that if not set will initialise with a random seed.

Returns:
Instances of `np.random.Generator`
Instances of `np.random.Generator`.
"""
return super().np_random

Expand All @@ -400,9 +413,10 @@ def np_random(self, value: np.random.Generator):
self._np_random = value

def __str__(self):
"""Returns a string of the environment with :attr:`spec` id's if :attr:`spec.
"""Returns a string of the environment with :attr:`spec` id's if :attr:`spec`.

Returns:
A string identifying the environment
A string identifying the environment.
"""
if self.spec is None:
return f"<{type(self).__name__} instance>"
Expand All @@ -422,6 +436,7 @@ def __exit__(self, *args: Any):
@property
def agent_ids(self) -> Set[str]:
"""Agent ids of all agents that potentially will be in the environment.

Returns:
(Set[str]): Agent ids.
"""
Expand All @@ -430,6 +445,7 @@ def agent_ids(self) -> Set[str]:
@property
def agent_interfaces(self) -> Dict[str, AgentInterface]:
"""Agent interfaces used for the environment.

Returns:
(Dict[str, AgentInterface]):
Agent interface defining the agents affect on the observation and action spaces
Expand All @@ -440,8 +456,9 @@ def agent_interfaces(self) -> Dict[str, AgentInterface]:
@property
def scenario_log(self) -> Dict[str, Union[float, str]]:
"""Simulation steps log.

Returns:
Dict[str, Union[float,str]]: A dictionary with the following keys.
(Dict[str, Union[float,str]]): A dictionary with the following keys.
fixed_timestep_sec - Simulation timestep.
scenario_map - Name of the current scenario.
scenario_traffic - Traffic spec(s) used.
Expand All @@ -459,7 +476,8 @@ def scenario_log(self) -> Dict[str, Union[float, str]]:
@property
def scenario(self) -> Scenario:
"""Returns underlying scenario.

Returns:
Scenario: Current simulated scenario.
scenario.Scenario: Current simulated scenario.
"""
return self._smarts.scenario
Loading