Liking cljdoc? Tell your friends :D

shams.priority-queue


Bufferablecljprotocol

insert-intoclj

(insert-into elements element)

Inserts an element into the elements buffer.

Inserts an element into the elements buffer.

remove-fromclj

(remove-from elements)

Removes an element from the elements buffer.

Removes an element from the elements buffer.
source

priority-forclj

(priority-for priority-queue element)

Returns the priority of the element if it were to be inserted into the priority queue.

Returns the priority of the element if it were to be inserted into the priority queue.
sourceraw docstring

priority-queueclj

(priority-queue element->priority
                &
                {:keys [elements priority-comparator variant]
                 :or {priority-comparator (fn* [p1__1881# p2__1880#]
                                               (compare p2__1880# p1__1881#))
                      variant :queue}})

Factory function to create a priority queue populated by elements. The element->priority is invoked on an element to compute the priority. The priority-comparator (defaults to larger values having higher priority) is used to order priorities. The variant (defaults to :queue) is used to determine how to break ties for equal priority elements. Valid values for variant are :queue (FIFO ordering) and :set (random tie-breaking).

Factory function to create a priority queue populated by elements.
The element->priority is invoked on an element to compute the priority.
The priority-comparator (defaults to larger values having higher priority) is used to order priorities.
The variant (defaults to :queue) is used to determine how to break ties for equal priority elements.
Valid values for variant are :queue (FIFO ordering) and :set (random tie-breaking).
sourceraw docstring

priority-queue->available-prioritiesclj

(priority-queue->available-priorities priority-queue)

Returns a sorted vector of available priorities in the queue.

Returns a sorted vector of available priorities in the queue.
sourceraw docstring

priority-queue->element->priorityclj

(priority-queue->element->priority priority-queue)

Returns the function used to compute the priority of elements in the priority queue.

Returns the function used to compute the priority of elements in the priority queue.
sourceraw docstring

priority-queue->top-priorityclj

(priority-queue->top-priority priority-queue)

Returns the highest priority of the available elements in the priority queue.

Returns the highest priority of the available elements in the priority queue.
sourceraw docstring

priority-queue?clj

(priority-queue? reference)

Returns true if the reference passed in is an instance of a priority queue.

Returns true if the reference passed in is an instance of a priority queue.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close