Skip to content

Commit

Permalink
Documentation (#2630)
Browse files Browse the repository at this point in the history
* chore: formatting

* fix: changed zsh: command not found: self.rng.randint to zsh: command not found: self.rng.integers
  • Loading branch information
Spartan-71 authored Jan 19, 2025
1 parent 2847dc1 commit d680bf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ class MyModel(Model):
def __init__(self, n_agents=10, seed=None):
super().__init__(seed=seed)
# Initialize the model with N agents

The core functionality for building your own visualizations resides in the [`mesa.visualization`](apis/visualization) namespace
```
The core functionality for building your own visualizations resides in the [`mesa.visualization`](apis/visualization) namespace.

Here's a basic example of how to set up a visualization:

Expand Down
8 changes: 5 additions & 3 deletions docs/tutorials/intro_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@
{
"cell_type": "raw",
"metadata": {},
"source": "pip install --quiet --upgrade mesa[rec] #installs Mesa 3.1.3"
"source": [
"pip install --quiet --upgrade mesa[rec] #installs Mesa 3.1.3"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -607,8 +609,8 @@
" # Create agents\n",
" agents = MoneyAgent.create_agents(model=self, n=n)\n",
" # Create x and y positions for agents\n",
" x = self.rng.randint(0, self.grid.width, size=(n,))\n",
" y = self.rng.randint(0, self.grid.height, size=(n,))\n",
" x = self.rng.integers(0, self.grid.width, size=(n,))\n",
" y = self.rng.integers(0, self.grid.height, size=(n,))\n",
" for a, i, j in zip(agents, x, y):\n",
" # Add the agent to a random grid cell\n",
" self.grid.place_agent(a, (i, j))"
Expand Down

0 comments on commit d680bf4

Please sign in to comment.