Skip to content

Commit 2359a12

Browse files
authored
Merge pull request #642 from DavidBalash/mesa_overview_fix
Fix Mesa Overview documentation #641 issue.
2 parents 7311a8e + 534d828 commit 2359a12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/overview.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ The skeleton of a model might look like this:
3636
class MyAgent(Agent):
3737
def __init__(self, name, model):
3838
super().__init__(name, model)
39+
self.name = name
3940
4041
def step(self):
4142
print("{} activated".format(self.name))
4243
# Whatever else the agent does when activated
4344
4445
class MyModel(Model):
4546
def __init__(self, n_agents):
47+
super().__init__()
4648
self.schedule = RandomActivation(self)
4749
self.grid = MultiGrid(10, 10, torus=True)
4850
for i in range(n_agents):
@@ -149,7 +151,7 @@ To quickly spin up a model visualization, you might do something like:
149151
server = ModularServer(MyModel,
150152
[grid],
151153
"My Model",
152-
100, 10, 10)
154+
{'n_agents': 10})
153155
server.launch()
154156
155157
This will launch the browser-based visualization, on the default port 8521.

0 commit comments

Comments
 (0)