File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1- from mesa import Agent , Model
2- from mesa .space import SingleGrid
3- from mesa .time import RandomActivation
1+ import mesa
42
53
6- class SchellingAgent (Agent ):
4+ class SchellingAgent (mesa . Agent ):
75 """
86 Schelling segregation agent
97 """
@@ -34,7 +32,7 @@ def step(self):
3432 self .model .happy += 1
3533
3634
37- class Schelling (Model ):
35+ class Schelling (mesa . Model ):
3836 """
3937 Model class for the Schelling segregation model.
4038 """
@@ -51,8 +49,8 @@ def __init__(
5149 self .homophily = homophily
5250 self .radius = radius
5351
54- self .schedule = RandomActivation (self )
55- self .grid = SingleGrid (height , width , torus = True )
52+ self .schedule = mesa . time . RandomActivation (self )
53+ self .grid = mesa . space . SingleGrid (height , width , torus = True )
5654
5755 self .happy = 0
5856
You can’t perform that action at this time.
0 commit comments