Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
quaquel committed Mar 11, 2024
1 parent d0611e3 commit 287f138
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mesa/experimental/devs/eventlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class Priority(IntEnum):
class SimulationEvent:
"""A simulation event
the callable is wrapped using weakrefs, so there is no need to explicitly cancel event if e.g., an agent
the callable is wrapped using weakref, so there is no need to explicitly cancel event if e.g., an agent
is removed from the simulation.
Attributes:
time (float): The simulation time of the event
function (Callable): The function to execute for this event
fn (Callable): The function to execute for this event
priority (Priority): The priority of the event
unique_id (int) the unique identifier of the event
function_args (list[Any]): Argument for the function
Expand Down Expand Up @@ -155,7 +155,7 @@ def remove(self, event: SimulationEvent) -> None:
"""remove an event from the event list"""
# we cannot simply remove items from _eventlist because this breaks
# heap structure invariant. So, we use a form of lazy deletion.
# SimEvents have a CANCELED flag that we set to True, while poping and peak_ahead
# SimEvents have a CANCELED flag that we set to True, while popping and peak_ahead
# silently ignore canceled events
event.cancel()

Expand Down
2 changes: 1 addition & 1 deletion mesa/experimental/devs/examples/epstein_civil_violence.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def update_estimated_arrest_probability(self):
self.arrest_probability = 1 - math.exp(
-1 * self.arrest_prob_constant * (cops_in_vision / actives_in_vision)
)

def sent_to_jail(self, value):
self.model.active_agents.remove(self)
self.condition = AgentState.ARRESTED
Expand Down

0 comments on commit 287f138

Please sign in to comment.