From 8869b3f64e6755a7fd03244c485581e3d5b199c5 Mon Sep 17 00:00:00 2001 From: Vaibhav sharma Date: Tue, 17 Dec 2024 01:43:43 +0530 Subject: [PATCH 1/3] Fix why agent not getting happy in run before reset. Update homophily to 0.4 --- mesa/examples/basic/schelling/app.py | 2 +- mesa/examples/basic/schelling/model.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mesa/examples/basic/schelling/app.py b/mesa/examples/basic/schelling/app.py index d9811b51b52..8eb3f6b3f38 100644 --- a/mesa/examples/basic/schelling/app.py +++ b/mesa/examples/basic/schelling/app.py @@ -26,7 +26,7 @@ def agent_portrayal(agent): }, "density": Slider("Agent density", 0.8, 0.1, 1.0, 0.1), "minority_pc": Slider("Fraction minority", 0.2, 0.0, 1.0, 0.05), - "homophily": Slider("Homophily", 0.3, 0.0, 0.8, 0.1), + "homophily": Slider("Homophily", 0.4, 0.0, 1.0, 0.1), "width": 20, "height": 20, } diff --git a/mesa/examples/basic/schelling/model.py b/mesa/examples/basic/schelling/model.py index 3ee0746c073..031ccbc2562 100644 --- a/mesa/examples/basic/schelling/model.py +++ b/mesa/examples/basic/schelling/model.py @@ -9,11 +9,11 @@ class Schelling(Model): def __init__( self, - height: int = 40, - width: int = 40, + height: int = 20, + width: int = 20, density: float = 0.8, minority_pc: float = 0.5, - homophily: int = 3, + homophily: float = 0.4, radius: int = 1, seed=None, ): From dfd9d410d0bddf13867242ee022b5fb8281ca49e Mon Sep 17 00:00:00 2001 From: Vaibhav sharma Date: Tue, 17 Dec 2024 01:50:03 +0530 Subject: [PATCH 2/3] Update homophily value in configurations.py file --- benchmarks/configurations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/configurations.py b/benchmarks/configurations.py index 95bb41c806a..bb69176731c 100644 --- a/benchmarks/configurations.py +++ b/benchmarks/configurations.py @@ -35,7 +35,7 @@ "parameters": { "height": 40, "width": 40, - "homophily": 3, + "homophily": 0.4, "radius": 1, "density": 0.625, }, @@ -47,7 +47,7 @@ "parameters": { "height": 100, "width": 100, - "homophily": 8, + "homophily": 0.4, "radius": 2, "density": 0.8, }, From 59e96921b1162d1458ffaceddfc460f035b86d20 Mon Sep 17 00:00:00 2001 From: Vaibhav sharma Date: Fri, 20 Dec 2024 21:44:36 +0530 Subject: [PATCH 3/3] Small fixes in Schelling example --- benchmarks/configurations.py | 2 +- mesa/examples/basic/schelling/app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/configurations.py b/benchmarks/configurations.py index bb69176731c..e1e193c4e6d 100644 --- a/benchmarks/configurations.py +++ b/benchmarks/configurations.py @@ -47,7 +47,7 @@ "parameters": { "height": 100, "width": 100, - "homophily": 0.4, + "homophily": 1, "radius": 2, "density": 0.8, }, diff --git a/mesa/examples/basic/schelling/app.py b/mesa/examples/basic/schelling/app.py index 8eb3f6b3f38..688a7fd2f0d 100644 --- a/mesa/examples/basic/schelling/app.py +++ b/mesa/examples/basic/schelling/app.py @@ -26,7 +26,7 @@ def agent_portrayal(agent): }, "density": Slider("Agent density", 0.8, 0.1, 1.0, 0.1), "minority_pc": Slider("Fraction minority", 0.2, 0.0, 1.0, 0.05), - "homophily": Slider("Homophily", 0.4, 0.0, 1.0, 0.1), + "homophily": Slider("Homophily", 0.4, 0.0, 1.0, 0.125), "width": 20, "height": 20, }