diff --git a/tests/test_other_functions.py b/tests/test_other_functions.py index 64937ac..d4edd2a 100644 --- a/tests/test_other_functions.py +++ b/tests/test_other_functions.py @@ -784,13 +784,13 @@ def veh_user_function(veh): assert equal_tolerance(np.nanmean(link1.user_attribute["speed_record"]), 15.89) -def test_reduce_memory_delele_vehicle_route_pref(): +def test_reduce_memory_delete_vehicle_route_pref(): W = World( name="", deltan=10, tmax=3000, print_mode=1, save_mode=1, show_mode=0, - reduce_memory_delele_vehicle_route_pref=False, + reduce_memory_delete_vehicle_route_pref=False, random_seed=0, ) @@ -875,4 +875,4 @@ def test_reduce_memory_delele_vehicle_route_pref(): df2 = W.analyzer.area_to_pandas(list(area_dict.values()), list(area_dict.keys()), border_include=True) print(df2) - assert df1["total_travel_time"][0] == df2["total_travel_time"][0] \ No newline at end of file + assert df1["total_travel_time"][0] == df2["total_travel_time"][0] diff --git a/uxsim/uxsim.py b/uxsim/uxsim.py index 3e6a916..b187f4b 100644 --- a/uxsim/uxsim.py +++ b/uxsim/uxsim.py @@ -137,7 +137,7 @@ def __init__(s, W, name, x, y, signal=[0], signal_offset=0, flow_capacity=None, raise ValueError(f"Node name {s.name} already used by another node. Please specify a unique name.") s.W.NODES.append(s) s.W.NODES_NAME_DICT[s.name] = s - + def __repr__(s): return f"" @@ -590,6 +590,7 @@ def __init__(s, W, name, start_node, end_node, length, free_flow_speed=20, jam_d if s.edie_dx < s.u*s.W.DELTAT: s.edie_dx = s.u*s.W.DELTAT + def __repr__(s): return f"" @@ -979,7 +980,6 @@ def __init__(s, W, orig, dest, departure_time, name=None, route_pref=None, route s.W.VEHICLES[s.name] = s s.W.VEHICLES_LIVING[s.name] = s - def __repr__(s): return f"" @@ -1086,7 +1086,7 @@ def end_trip(s): s.record_log(enforce_log=1) - if s.W.reduce_memory_delele_vehicle_route_pref: + if s.W.reduce_memory_delete_vehicle_route_pref: s.route_pref = None def carfollow(s): @@ -1432,7 +1432,7 @@ def __init__(W, name="", deltan=5, reaction_time=1, print_mode=1, save_mode=1, show_mode=0, show_progress=1, show_progress_deltat=600, tmax=None, vehicle_logging_timestep_interval=1, - reduce_memory_delele_vehicle_route_pref=False, + reduce_memory_delete_vehicle_route_pref=False, hard_deterministic_mode=False, meta_data={}, user_attribute=None, user_function=None): """ @@ -1483,7 +1483,7 @@ def __init__(W, name="", deltan=5, reaction_time=1, If it is longer than the DUO update timestep interval, it is substituted by DUO update timestep interval to maintain reasonable route choice behavior. hard_deterministic_mode : bool, optional If True, the simulation will not use any random variables. At a merging node, a link with higher merge_priority will be always prioritized, and vehicles always choose the shortest path. This may be useful for analysis that need strict predictability. Be aware that the simulation results will be significantly different from ones with `hard_deterministic_mode=False`. - reduce_memory_delele_vehicle_route_pref : bool, optional + reduce_memory_delete_vehicle_route_pref : bool, optional If True, the simulation will delete the route preference of vehicles after its ends. This is useful when the route preference is not needed after the simulation ends. meta_data : dict, optinal Meta data for simulation scenario. Can store arbitrary data, such as licences and simulation explanation. @@ -1549,7 +1549,7 @@ def __init__(W, name="", deltan=5, reaction_time=1, W.show_progress_deltat_timestep = int(show_progress_deltat/W.DELTAT) ## memory setting - W.reduce_memory_delele_vehicle_route_pref = reduce_memory_delele_vehicle_route_pref + W.reduce_memory_delete_vehicle_route_pref = reduce_memory_delete_vehicle_route_pref ## system setting W.name = name