Skip to content

Commit

Permalink
Minor style changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
michalgregor committed Oct 19, 2022
1 parent e9fd47c commit 2526bc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sumo_rl/environment/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SumoEnvironment(gym.Env):
:param min_green: (int) Minimum green time in a phase
:param max_green: (int) Max green time in a phase
:single_agent: (bool) If true, it behaves like a regular gym.Env. Else, it behaves like a MultiagentEnv (https://github.com/ray-project/ray/blob/master/python/ray/rllib/env/multi_agent_env.py)
:reward_fn: (str/function/dict) String with the name of the reward function used by the agents, a reward function, or dictionary with rewards functions assigned to individual traffic lights by its keys
:reward_fn: (str/function/dict) String with the name of the reward function used by the agents, a reward function, or dictionary with reward functions assigned to individual traffic lights by their keys
:add_system_info: (bool) If true, it computes system metrics (total queue, total waiting time, average speed) in the info dictionary
:add_per_agent_info: (bool) If true, it computes per-agent (per-traffic signal) metrics (average accumulated waiting time, average queue) in the info dictionary
:sumo_seed: (int/string) Random seed for sumo. If 'random' it uses a randomly chosen seed.
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(
self.ts_ids = list(conn.trafficlight.getIDList())

if isinstance(self.reward_fn, dict):
self.traffic_signals = {}
self.traffic_signals = dict()
for key, reward_fn_value in self.reward_fn.items():
self.traffic_signals[key] = TrafficSignal(
self,
Expand Down Expand Up @@ -223,7 +223,7 @@ def reset(self, seed: Optional[int] = None, **kwargs):
self._start_simulation()

if isinstance(self.reward_fn, dict):
self.traffic_signals = {}
self.traffic_signals = dict()
for key, reward_fn_value in self.reward_fn.items():
self.traffic_signals[key] = TrafficSignal(
self,
Expand Down

0 comments on commit 2526bc9

Please sign in to comment.