Skip to content

Commit d4b18cd

Browse files
authored
gis: Replace initialize_data_collector with direct DataCollector (#208)
1 parent de5cda9 commit d4b18cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gis/urban_growth/urban_growth/model.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import mesa
44
import numpy as np
5+
from mesa import DataCollector
56

67
from .space import City
78

@@ -52,9 +53,10 @@ def __init__(
5253
cell.road_pixel = None
5354
cell.model = self
5455

55-
self.initialize_data_collector(
56+
self.datacollector = DataCollector(
5657
model_reporters={"Percentage Urbanized": "pct_urbanized"}
5758
)
59+
self.datacollector.collect(self)
5860

5961
@property
6062
def pct_urbanized(self) -> float:

0 commit comments

Comments
 (0)