I tried this today:

immutable State
    a::Int
    b::Int
end

import Base.Collections: PriorityQueue, enqueue!, dequeue!, peek

pq = PriorityQueue(Int,Int)

enqueue!(pq, State(5,3), 4)
enqueue!(pq, State(5,3), 2)

but it fails with the error

LoadError: ArgumentError: PriorityQueue keys must be unique

I assume this is because the states are immutable, and thus compare equal 
if all their values compare equal. Is there a way to make a priority queue 
insert the same state on several priorities, i.e. to support my example 
above?

// T
​

Reply via email to