Skip to content

Commit 938e3ca

Browse files
vbv-shmquaquel
andauthored
Added homophily ratio in basic schelling example (projectmesa#2520)
* Fix why agent not getting happy in run before reset. Update homophily to 0.4 * Update homophily value in configurations.py file * Small fixes in Schelling example --------- Co-authored-by: Vaibhav sharma <vaibhav.8june.com> Co-authored-by: Jan Kwakkel <[email protected]>
1 parent dd77c0a commit 938e3ca

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

benchmarks/configurations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"parameters": {
3636
"height": 40,
3737
"width": 40,
38-
"homophily": 3,
38+
"homophily": 0.4,
3939
"radius": 1,
4040
"density": 0.625,
4141
},
@@ -47,7 +47,7 @@
4747
"parameters": {
4848
"height": 100,
4949
"width": 100,
50-
"homophily": 8,
50+
"homophily": 1,
5151
"radius": 2,
5252
"density": 0.8,
5353
},

mesa/examples/basic/schelling/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def agent_portrayal(agent):
2626
},
2727
"density": Slider("Agent density", 0.8, 0.1, 1.0, 0.1),
2828
"minority_pc": Slider("Fraction minority", 0.2, 0.0, 1.0, 0.05),
29-
"homophily": Slider("Homophily", 0.3, 0.0, 0.8, 0.1),
29+
"homophily": Slider("Homophily", 0.4, 0.0, 1.0, 0.125),
3030
"width": 20,
3131
"height": 20,
3232
}

mesa/examples/basic/schelling/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class Schelling(Model):
99

1010
def __init__(
1111
self,
12-
height: int = 40,
13-
width: int = 40,
12+
height: int = 20,
13+
width: int = 20,
1414
density: float = 0.8,
1515
minority_pc: float = 0.5,
16-
homophily: int = 3,
16+
homophily: float = 0.4,
1717
radius: int = 1,
1818
seed=None,
1919
):

0 commit comments

Comments
 (0)