Skip to content

Commit

Permalink
Add type hints to agent class
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Oct 13, 2024
1 parent f4b9156 commit e488ab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/schelling/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SchellingAgent(mesa.Agent):
Schelling segregation agent
"""

def __init__(self, model, agent_type):
def __init__(self, model: mesa.Model, agent_type: int) -> None:
"""
Create a new Schelling agent.
Expand All @@ -16,7 +16,7 @@ def __init__(self, model, agent_type):
super().__init__(model)
self.type = agent_type

def step(self):
def step(self) -> None:
neighbors = self.model.grid.iter_neighbors(
self.pos, moore=True, radius=self.model.radius
)
Expand Down

0 comments on commit e488ab1

Please sign in to comment.