@@ -69,6 +69,7 @@ def __init__(
69
69
lakes_file = script_directory / "../../data/ub/hydrop.zip" ,
70
70
rivers_file = script_directory / "../../data/ub/hydrol.zip" ,
71
71
driveway_file = script_directory / "../../data/data/ub/UB_Rds.zip" ,
72
+ output_dir = script_directory / "../../outputs" ,
72
73
num_commuters = 50 ,
73
74
commuter_min_friends = 5 ,
74
75
commuter_max_friends = 10 ,
@@ -97,7 +98,9 @@ def __init__(
97
98
Commuter .CHANCE_NEW_FRIEND = chance_new_friend
98
99
99
100
self ._load_buildings_from_file (buildings_file , crs = model_crs , campus = campus )
100
- self ._load_road_vertices_from_file (walkway_file , crs = model_crs , campus = campus )
101
+ self ._load_road_vertices_from_file (
102
+ walkway_file , crs = model_crs , campus = campus , output_dir = output_dir
103
+ )
101
104
self ._set_building_entrance ()
102
105
self .got_to_destination = 0
103
106
self ._create_commuters ()
@@ -167,14 +170,16 @@ def _load_buildings_from_file(
167
170
self .space .add_buildings (buildings )
168
171
169
172
def _load_road_vertices_from_file (
170
- self , walkway_file : str , crs : str , campus : str
173
+ self , walkway_file : str , crs : str , campus : str , output_dir : str
171
174
) -> None :
172
175
walkway_df = (
173
176
gpd .read_file (walkway_file )
174
177
.set_crs (self .data_crs , allow_override = True )
175
178
.to_crs (crs )
176
179
)
177
- self .walkway = CampusWalkway (campus = campus , lines = walkway_df ["geometry" ])
180
+ self .walkway = CampusWalkway (
181
+ campus = campus , lines = walkway_df ["geometry" ], output_dir = output_dir
182
+ )
178
183
if self .show_walkway :
179
184
walkway_creator = mg .AgentCreator (Walkway , model = self )
180
185
walkway = walkway_creator .from_GeoDataFrame (walkway_df )
0 commit comments