Skip to content

Commit

Permalink
Merge pull request projectmesa#896 from tpike3/master
Browse files Browse the repository at this point in the history
fix python 3.5 fails take 2
  • Loading branch information
tpike3 authored Aug 24, 2020
2 parents 09b6cd5 + 96f68e6 commit c808a7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mesa/batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def __init__(
self.agent_reporters = agent_reporters

if self.model_reporters:
self.model_vars = {}
self.model_vars = OrderedDict()

if self.agent_reporters:
self.agent_vars = {}
self.agent_vars = OrderedDict()

# Make Compatible with Python 3.5
self.datacollector_model_reporters = OrderedDict()
Expand Down Expand Up @@ -274,15 +274,15 @@ def run_model(self, model):

def collect_model_vars(self, model):
""" Run reporters and collect model-level variables. """
model_vars = OrderedDict()
model_vars = {}
for var, reporter in self.model_reporters.items():
model_vars[var] = reporter(model)

return model_vars

def collect_agent_vars(self, model):
""" Run reporters and collect agent-level variables. """
agent_vars = OrderedDict()
agent_vars = {}
for agent in model.schedule._agents.values():
agent_record = {}
for var, reporter in self.agent_reporters.items():
Expand Down Expand Up @@ -524,7 +524,7 @@ def run_all(self):
run_iter_args, total_iterations = self._make_model_args_mp()
# register the process pool and init a queue
# store results in ordered dictionary
results = OrderedDict()
results = {}

if self.processes > 1:
with tqdm(total_iterations, disable=not self.display_progress) as pbar:
Expand Down

0 comments on commit c808a7e

Please sign in to comment.