Event

Definition of the Event class.

This module defines the Event class, which is executed by the timeline. Events should be scheduled through the timeline to take effect.

class src.kernel.event.Event(time: int, process: Process, priority=inf)

Class of events for simulation.

Events are sorted by their time and priority. Events with lower times come before events with higher times. Events with the same time are sorted by their priority from low to high.

time

the execution time of the event.

Type:

int

process

the process encapsulated in the event.

Type:

Process

priority

the priority of the event, lower value denotes a higher priority.

Type:

int

_is_removed

the flag to denotes if it’s a valid event

Type:

bool