HeapQueue

class vindinium.ai.HeapQueue[source]

Bases: object

A priority queue implementation (it uses the heapq builtin module).

Based on http://www.redblobgames.com/pathfinding/a-star/implementation.html

__init__()[source]

Constructor.

is_empty()[source]

Verifies if the queue is empty or not.

Returns:(bool) whether if the queue is empty or not.
pop()[source]

Pops an item from the queue.

Returns:(object) the stored item.
push(item, priority)[source]

Pushes an item to the queue, given a priority.

Parameters:
  • (object) any object. (item) –
  • (int) a priority value. (priority) –