Skip to content

Commit 2e7fa4b

Browse files
Merge pull request #267 from kjang96/registry_vehicles
Deep copy vehicles variable in create_env, which will allow for clean…
2 parents 21144b7 + 9b1ae70 commit 2e7fa4b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

flow/utils/registry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ def make_create_env(params, version=0, render=None):
6262

6363
env_params = params['env']
6464
net_params = params['net']
65-
vehicles = params['veh']
6665
initial_config = params.get('initial', InitialConfig())
6766
traffic_lights = params.get("tls", TrafficLights())
6867

6968
def create_env(*_):
69+
sumo_params = deepcopy(params['sumo'])
70+
vehicles = deepcopy(params['veh'])
71+
7072
scenario = scenario_class(
7173
name=exp_tag,
7274
vehicles=vehicles,
@@ -75,8 +77,6 @@ def create_env(*_):
7577
traffic_lights=traffic_lights,
7678
)
7779

78-
sumo_params = deepcopy(params['sumo'])
79-
8080
if render is not None:
8181
sumo_params.render = render
8282

0 commit comments

Comments
 (0)