pypdevsbbl.extra.queues module

Helper file for pypdevsbbl.generic.queues.

This file contains common queueing disciplines and the element that will be enqueued in the pypdevsbbl.generic.queues.SimpleQueue and pypdevsbbl.generic.queues.Queue building blocks.

pypdevsbbl.extra.queues.FIFO(time, val, ix)

First-In-First-Out kind of queue. This is the most commonly used one.

Note

Keep in mind that we use a maxheap in our queue.

pypdevsbbl.extra.queues.FCFS(time, val, ix)

Alias for FIFO().

pypdevsbbl.extra.queues.LIFO(time, val, ix)

Last-In-First-Out kind of queue. This is used for stacks etc.

Note

Keep in mind that we use a maxheap in our queue.

class pypdevsbbl.extra.queues.QueueElement(priority, item, arrival_time)[source]

Bases: object

Simple Queue Element for storing all necessary information and doing valid comparisons.

Creates a special kind of tuple for enqueueing items, allowing for sorting on priorities and remembering their arrival times (which is used for reneging).

Warning

This is not a DEVS building block.

Parameters:
  • priority (comparable) – The priority of the item in the queue.
  • item (any) – The item to enqueue.
  • arrival_time (numeric) – (Absolute) time of arrival of the item.
Variables:
  • priority (comparable) – The priority of the item in the queue.
  • item (any) – The item to enqueue.
  • arrival_time (numeric) – (Absolute) time of arrival of the item.