We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9d817a commit 96fdd4eCopy full SHA for 96fdd4e
mesa/experimental/measure.py
@@ -72,11 +72,13 @@ def run():
72
def __init__(self, model, attributes):
73
self.model = model
74
self.attributes = attributes
75
- self.data_collection = defaultdict(list)
+ self.data_collection = defaultdict(lambda: defaultdict(list))
76
77
def collect(self):
78
for name in self.attributes:
79
attribute = getattr(self.model, name)
80
+ group = "model"
81
if isinstance(attribute, Measure):
82
+ group = attribute.group
83
attribute = attribute.value
- self.data_collection[name] = attribute
84
+ self.data_collection[group][name].append(attribute)
0 commit comments