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

fix: set traci default view if it doesn't exist #191

Merged
merged 5 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/documentation/observations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Observation Functions

To create a new obsevation function, you must create a class that inherits from the ObservationFunction class:
To create a new observation function, you must create a class that inherits from the ObservationFunction class:

```{eval-rst}
.. autoclass:: sumo_rl.environment.observations.ObservationFunction
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ reportInvalidTypeVarUse = "none"
# reportUnknownVariableType = "warning" # -> raises warnings
# reportUnknownArgumentType = "warning" # -> raises warnings
reportGeneralTypeIssues = "none" # -> commented out raises 489 errors
reportArgumentType = "none"
reportUntypedFunctionDecorator = "none" # -> pytest.mark.parameterize issues

reportOptionalMemberAccess = "none" # -> commented out raises warnings
reportPrivateImportUsage = "warning" # -> this raises warnings because we use not exported modules from gym (wrappers)

reportPrivateUsage = "warning"
reportUnboundVariable = "warning"
reportCallIssue = "warning"
reportAttributeAccessIssue = "warning"

[tool.pytest.ini_options]
filterwarnings = ['ignore:.*The environment .* is out of date.*']
Expand Down
2 changes: 2 additions & 0 deletions sumo_rl/environment/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def _start_simulation(self):
self.sumo = traci.getConnection(self.label)

if self.use_gui or self.render_mode is not None:
if "DEFAULT_VIEW" not in dir(traci.gui): # traci.gui.DEFAULT_VIEW is not defined in libsumo
traci.gui.DEFAULT_VIEW = "View #0"
self.sumo.gui.setSchema(traci.gui.DEFAULT_VIEW, "real world")

def reset(self, seed: Optional[int] = None, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions sumo_rl/environment/resco_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def grid4x4(parallel=True, **kwargs):

Number of agents = 16
Number of actions = 4
Agents have the same obsevation and action space
Agents have the same observation and action space
"""
kwargs.update(
{
Expand All @@ -33,7 +33,7 @@ def arterial4x4(parallel=True, **kwargs):

Number of agents = 16
Number of actions = 5
Agents have the same obsevation and action space
Agents have the same observation and action space
"""
kwargs.update(
{
Expand Down Expand Up @@ -73,7 +73,7 @@ def cologne3(parallel=True, **kwargs):

Number of agents: 3
Number of actions: 2 agents with 4 actions and 1 agent with 3 actions
2 agents have the same obsevation and action space and 1 has different spaces
2 agents have the same observation and action space and 1 has different spaces
"""
kwargs.update(
{
Expand Down
271 changes: 0 additions & 271 deletions sumo_rl/util/xml2csv.py

This file was deleted.

Loading
Loading