From d680bf4719933756a41cced3a4f17620e0be9381 Mon Sep 17 00:00:00 2001 From: Anish Dabhane Date: Mon, 20 Jan 2025 00:22:30 +0530 Subject: [PATCH] Documentation (#2630) * chore: formatting * fix: changed zsh: command not found: self.rng.randint to zsh: command not found: self.rng.integers --- docs/getting_started.md | 4 ++-- docs/tutorials/intro_tutorial.ipynb | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 3345521df4d..125c902bcdb 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -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: diff --git a/docs/tutorials/intro_tutorial.ipynb b/docs/tutorials/intro_tutorial.ipynb index a99bd24acfd..02e0993387f 100644 --- a/docs/tutorials/intro_tutorial.ipynb +++ b/docs/tutorials/intro_tutorial.ipynb @@ -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", @@ -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))"