Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 1, 2025
1 parent dba5fe8 commit e2663e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ One significant advancement of Mesa 3+ is expanded functionality around agent ma
# Select wealthy agents and calculate average wealth
wealthy = model.agents.select(lambda a: a.wealth > 1000)
avg_wealth = wealthy.agg("wealth", func=np.mean)

# Group agents by type and apply behaviors
grouped = model.agents.groupby("species")
for species, agents in grouped:
Expand Down Expand Up @@ -127,7 +127,7 @@ Typically, ABMs rely on incremental time progression or ticks. For each tick, th

```python
model = Model(seed=42)

for _ in range(100):
model.step()
```
Expand All @@ -136,13 +136,13 @@ Generally, within the step method of the model, one activates all the agents. Th

```python
model.agents.do("step") # Sequential activation

model.agents.shuffle_do("step") # Random activation

# Multi-stage activation:
for stage in ["move", "eat", "reproduce"]:
model.agents.do(stage)

# Activation by agent subclass:
for klass in model.agent_types:
model.agents_by_type[klass].do("step")
Expand All @@ -155,7 +155,7 @@ Mesa also supports next-event time progression. In this approach, the simulation
simulator = DiscreteEventSimulator()
model = Model(seed=42, simulator=simulator)
simulator.schedule_event_relative(some_function, 3.1415)

# Hybrid time-step and event scheduling
model = Model(seed=42, simulator=ABMSimulator())
model.simulator.schedule_event_next_tick(some_function)
Expand Down

0 comments on commit e2663e5

Please sign in to comment.