Skip to content

Commit e488ab1

Browse files
committed
Add type hints to agent class
1 parent f4b9156 commit e488ab1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/schelling/model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class SchellingAgent(mesa.Agent):
66
Schelling segregation agent
77
"""
88

9-
def __init__(self, model, agent_type):
9+
def __init__(self, model: mesa.Model, agent_type: int) -> None:
1010
"""
1111
Create a new Schelling agent.
1212
@@ -16,7 +16,7 @@ def __init__(self, model, agent_type):
1616
super().__init__(model)
1717
self.type = agent_type
1818

19-
def step(self):
19+
def step(self) -> None:
2020
neighbors = self.model.grid.iter_neighbors(
2121
self.pos, moore=True, radius=self.model.radius
2222
)

0 commit comments

Comments
 (0)