SortedQueue

Bases: list

Queue for sorting events by their :attr:~PriorityRequest.key attribute.

maxlen = maxlen instance-attribute

Maximum length of the queue.

append(item)

Sort item into the queue.

Raise a :exc:RuntimeError if the queue is full.

PriorityGet

Bases: Get

priority = priority instance-attribute

The priority of this request. A smaller number means higher priority.

time = resource._env.now instance-attribute

The time at which the request was made.

PriorityPut

Bases: Put

priority = priority instance-attribute

The priority of this request. A smaller number means higher priority.

time = resource._env.now instance-attribute

The time at which the request was made.

PriorityReqStore

Bases: Store

This is a class derived from SimPy's Store class and has extra capabilities that makes it a priority-based store for put and get.

Processes can pass a priority as argument in the put and get request. Request with lower values of priority yields first among all get(or put) requests. If two requests with same priority are placed from two processes then FIFO order is followed to yield the requests.

get = BoundClass(PriorityGet) class-attribute instance-attribute

yields a get request with the given priority.

put = BoundClass(PriorityPut) class-attribute instance-attribute

yields a put request with the given priority