Skip to content

Commit a30cf7c

Browse files
authored
Update model.py
1 parent 1333c70 commit a30cf7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mesa/examples/basic/schelling/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(
1313
width: int = 40,
1414
density: float = 0.8,
1515
minority_pc: float = 0.5,
16-
homophily: int = 3,
16+
homophily_ratio: float = 0.3,
1717
radius: int = 1,
1818
seed=None,
1919
):
@@ -24,7 +24,7 @@ def __init__(
2424
height: Height of the grid
2525
density: Initial chance for a cell to be populated (0-1)
2626
minority_pc: Chance for an agent to be in minority class (0-1)
27-
homophily: Minimum number of similar neighbors needed for happiness
27+
homophily_ratio: Ratio of similar neighbors to total neighbors needed for happiness
2828
radius: Search radius for checking neighbor similarity
2929
seed: Seed for reproducibility
3030
"""
@@ -35,7 +35,7 @@ def __init__(
3535
self.width = width
3636
self.density = density
3737
self.minority_pc = minority_pc
38-
self.homophily = homophily
38+
self.homophily_ratio = homophily_ratio
3939
self.radius = radius
4040

4141
# Initialize grid

0 commit comments

Comments
 (0)