diff --git a/docs/conf.py b/docs/conf.py index b9ca723d82c..9d6ce6a64ae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -172,6 +172,7 @@ # Custom sidebar templates, maps document names to template names. html_sidebars = { + "getting_started": [], "migration_guide": [], # No sidebar migration } diff --git a/docs/getting_started.md b/docs/getting_started.md index 3237dc2700b..6a6d4a303ae 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -55,23 +55,4 @@ Enjoy modelling with Mesa, and feel free to reach out! -```{toctree} -:hidden: true -:maxdepth: 7 - -Overview -Creating Your First Model -Adding Space -Collecting Data -AgentSet -Basic Visualization -Dynamic Agent Visualization -Visualisation using SpaceRenderer -Property Layer Visualization -Custom Visualization Components -Parameter Sweeps -Comparing Scenarios -Best Practices - - -``` + diff --git a/docs/overview.md b/docs/overview.md index fd5610c5d8a..a4ce4cba4e5 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -309,10 +309,12 @@ Collecting Data AgentSet Basic Visualization Dynamic Agent Visualization -Custom Visualization Components -Parameter Sweeps -Comparing Scenarios +Visualisation using SpaceRenderer +Property Layer Visualization +Custom Visualization Components +Parameter Sweeps +Comparing Scenarios Best Practices -``` +``` \ No newline at end of file diff --git a/docs/tutorials/10_comparing_scenarios.ipynb b/docs/tutorials/10_comparing_scenarios.ipynb index fbc4deb087d..00a8b7d4d05 100644 --- a/docs/tutorials/10_comparing_scenarios.ipynb +++ b/docs/tutorials/10_comparing_scenarios.ipynb @@ -54,14 +54,16 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false + }, + "ExecuteTime": { + "end_time": "2025-11-11T08:25:06.210623Z", + "start_time": "2025-11-11T08:25:06.208637Z" } }, - "outputs": [], "source": [ "# Has multi-dimensional arrays and matrices.\n", "# Has a large collection of mathematical functions to operate on these arrays.\n", @@ -77,7 +79,9 @@ "\n", "# Import Cell Agent and OrthogonalMooreGrid\n", "from mesa.discrete_space import CellAgent, OrthogonalMooreGrid" - ] + ], + "outputs": [], + "execution_count": 10 }, { "cell_type": "markdown", @@ -92,9 +96,12 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2025-11-11T08:25:06.236288Z", + "start_time": "2025-11-11T08:25:06.231836Z" + } + }, "source": [ "def compute_gini(model):\n", " agent_wealths = [agent.wealth for agent in model.agents]\n", @@ -156,13 +163,18 @@ " self.datacollector.collect(self)\n", " self.agents.shuffle_do(\"move\")\n", " self.agents.do(\"give_money\")" - ] + ], + "outputs": [], + "execution_count": 11 }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2025-11-11T08:25:08.183010Z", + "start_time": "2025-11-11T08:25:06.256875Z" + } + }, "source": [ "params = {\"width\": 10, \"height\": 10, \"n\": range(5, 105, 5)}\n", "\n", @@ -175,7 +187,27 @@ " data_collection_period=1,\n", " display_progress=True,\n", ")" - ] + ], + "outputs": [ + { + "data": { + "text/plain": [ + " 0%| | 0/100 [00:00\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
RunIditerationStepseedwidthheightnGiniAgentIDWealthSteps_not_given
1001None101050.01.01.00.0
6002None101050.01.01.01.0
11003None101050.01.01.02.0
\n", + "" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 15 }, { "cell_type": "code", - "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false + }, + "ExecuteTime": { + "end_time": "2025-11-11T08:25:16.240439Z", + "start_time": "2025-11-11T08:25:11.090308Z" } }, - "outputs": [], "source": [ "# Create a lineplot with error bars\n", "g = sns.lineplot(\n", @@ -289,7 +461,9 @@ " \"(mean over 100 runs, with 95% confidence interval)\"\n", ")\n", "g.set(title=plot_title, ylabel=\"Gini coefficient\");" - ] + ], + "outputs": [], + "execution_count": 16 }, { "cell_type": "markdown", @@ -330,14 +504,16 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false + }, + "ExecuteTime": { + "end_time": "2025-11-11T08:25:16.306564Z", + "start_time": "2025-11-11T08:25:16.282651Z" } }, - "outputs": [], "source": [ "# Calculate the mean of the wealth and the number of consecutive rounds\n", "# for all agents in each episode.\n", @@ -347,18 +523,91 @@ " .reset_index()\n", ")\n", "agg_results_df.head(3)" - ] + ], + "outputs": [ + { + "data": { + "text/plain": [ + " iteration n Step Wealth Steps_not_given\n", + "0 0 5 0 NaN NaN\n", + "1 0 5 1 1.0 0.0\n", + "2 0 5 2 1.0 1.0" + ], + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
iterationnStepWealthSteps_not_given
0050NaNNaN
10511.00.0
20521.01.0
\n", + "
" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 17 }, { "cell_type": "code", - "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false + }, + "ExecuteTime": { + "end_time": "2025-11-11T08:25:19.502276Z", + "start_time": "2025-11-11T08:25:16.342019Z" } }, - "outputs": [], "source": [ "# Create a line plot with error bars\n", "g = sns.lineplot(\n", @@ -370,7 +619,9 @@ " \"different population sizes\\n(mean with 95% confidence interval)\",\n", " ylabel=\"Consecutive rounds without a transaction\",\n", ");" - ] + ], + "outputs": [], + "execution_count": 18 }, { "cell_type": "markdown",