From ebfabb8b51ca1bdec94fb9eb693d7eb3c971ca83 Mon Sep 17 00:00:00 2001 From: Spartan-71 Date: Sun, 19 Jan 2025 18:31:09 +0530 Subject: [PATCH 1/2] chore: formatting --- docs/getting_started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 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: From 1766841e8bcbbe1cbeaceb2fdf69a967ef1def48 Mon Sep 17 00:00:00 2001 From: Spartan-71 Date: Sun, 19 Jan 2025 18:31:58 +0530 Subject: [PATCH 2/2] fix: changed zsh: command not found: self.rng.randint to zsh: command not found: self.rng.integers --- docs/tutorials/intro_tutorial.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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))"