ast_toolbox.mcts.BoundedPriorityQueues module

class ast_toolbox.mcts.BoundedPriorityQueues.BoundedPriorityQueue(N)[source]

Bases: object

The bounded priority Queue.

Parameters:N (int) – Size of the queue.
empty()[source]

Clear the queue.

enqueue(k, v, make_copy=False)[source]

Storing k into the queue based on the priority value v.

Parameters:
  • k – The object to be stored.
  • v (float) – The priority value.
  • make_copy (bool, optional) – Whether to make a copy of the k.
haskey(k)[source]

Check whether k in in the queue.

Returns:has_key (bool) – Whether k in in the queue.
isempty()[source]

Check whether the queue is empty.

Returns:is_empty (bool) – Whether the queue is empty.
length()[source]

Return the current size of the queue.

Returns:length (int) – The current size of the queue.