1
0
mirror of https://github.com/gsi-upm/soil synced 2024-11-21 18:52:28 +00:00

Update tutorial and fix plotting bug

This commit is contained in:
J. Fernando Sánchez 2023-04-24 19:23:04 +02:00
parent 47a67f6665
commit eca4cae298
2 changed files with 127 additions and 74 deletions

File diff suppressed because one or more lines are too long

View File

@ -21,8 +21,10 @@ def plot(env, agent_df=None, model_df=None, steps=False, ignore=["agent_count",
except UserWarning:
print("No agent dataframe provided and no agent reporters found. Skipping agent plot.", file=sys.stderr)
return
agent_df.unstack().apply(lambda x: x.value_counts(),
axis=1).fillna(0).plot(ax=ax, secondary_y=True);
if not agent_df.empty:
agent_df.unstack().apply(lambda x: x.value_counts(),
axis=1).fillna(0).plot(ax=ax,
secondary_y=True)
Results = namedtuple("Results", ["config", "parameters", "env", "agents"])