Skip to content

Commit

Permalink
gis: Replace initialize_data_collector with direct DataCollector (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutH authored Sep 25, 2024
1 parent de5cda9 commit d4b18cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gis/urban_growth/urban_growth/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import mesa
import numpy as np
from mesa import DataCollector

from .space import City

Expand Down Expand Up @@ -52,9 +53,10 @@ def __init__(
cell.road_pixel = None
cell.model = self

self.initialize_data_collector(
self.datacollector = DataCollector(
model_reporters={"Percentage Urbanized": "pct_urbanized"}
)
self.datacollector.collect(self)

@property
def pct_urbanized(self) -> float:
Expand Down

0 comments on commit d4b18cd

Please sign in to comment.