You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the DiscreteEventScheduler (as of #1890) could be improved by allowing task interruptions and resumptions, and integrating system-level event handling.
Motivation
System-level events, such as policy changes or environmental shifts, can be crucial for simulating real-world scenarios. By enabling agents to interrupt and resume tasks and react to system-wide changes, we allows new systems to be modelled.
Description
The current implementation of the DiscreteEventScheduler in Mesa works great for simulations where agents operate based on discrete events. However, for more complex scenarios, especially those requiring dynamic interruption and resumption of tasks, as well as system-level event responses, the scheduler could benefit from additional functionalities.
Proposed Enhancements:
Enhanced Event Scheduling:
Modify schedule_event to check an agent's current task status before scheduling new tasks.
Implement logic to handle scenarios where an agent is already engaged in a task (e.g., delay or reschedule the new task).
Basic Interruption Handling:
Introduce a method in DiscreteEventScheduler to interrupt an agent's current task.
Update the agent's status to reflect the interruption and, optionally, reschedule the interrupted task for a later time.
System-Level Event Integration:
Implement a feature to schedule system-wide events that can affect multiple or all agents.
These events could trigger task interruptions or other significant changes in agent behavior.
Resumption Logic:
Develop a mechanism within agents to resume interrupted tasks.
This would involve checking their status at the beginning of their step method and deciding whether to continue a previous task or start a new one.
There is probably more that could fit in there. I think the most important is to think about the concepts of tasks in Mesa, a thing that an agent is currently working on, has some future benefit and can be interrupted by different things.
The text was updated successfully, but these errors were encountered:
EwoutH
changed the title
Enhancement the DiscreteEventScheduler to handle system-level events and task interruptions
Enable DiscreteEventScheduler to handle system-level events and task interruptions
Nov 28, 2023
I wrote this issue before the whole new DEVS scheduler was in. Now that it is, I would like to revisit it.
I want to introduce especially the concept of a Task. A Task takes a non-fixed time, which can be determined stochastically. It might also be able to be interrupted by an other agent or a system level event, and if so, there are multiple options to handle that.
The current implementation of the
DiscreteEventScheduler
(as of #1890) could be improved by allowing task interruptions and resumptions, and integrating system-level event handling.Motivation
System-level events, such as policy changes or environmental shifts, can be crucial for simulating real-world scenarios. By enabling agents to interrupt and resume tasks and react to system-wide changes, we allows new systems to be modelled.
Description
The current implementation of the
DiscreteEventScheduler
in Mesa works great for simulations where agents operate based on discrete events. However, for more complex scenarios, especially those requiring dynamic interruption and resumption of tasks, as well as system-level event responses, the scheduler could benefit from additional functionalities.Proposed Enhancements:
Enhanced Event Scheduling:
schedule_event
to check an agent's current task status before scheduling new tasks.Basic Interruption Handling:
DiscreteEventScheduler
to interrupt an agent's current task.System-Level Event Integration:
Resumption Logic:
step
method and deciding whether to continue a previous task or start a new one.There is probably more that could fit in there. I think the most important is to think about the concepts of tasks in Mesa, a thing that an agent is currently working on, has some future benefit and can be interrupted by different things.
The text was updated successfully, but these errors were encountered: