public abstract class DataFastLookupPriorityQueue
extends java.lang.Object
implements nl.tue.astar.util.FastLookupPriorityQueue
FastLookupPriorityQueue that allows to store
Objects instead of long values in the queue. Most code taken from
AbstractFastLookupPriorityQueue.| Modifier and Type | Field and Description |
|---|---|
protected it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap<DRecord> |
locationMap |
protected int |
maxCost
The maximum total cost for any record in this queue.
|
protected static int |
NEV |
protected DRecord[] |
queue
Priority queue represented as a balanced binary heap: the two children of
queue[n] are queue[2*n+1] and queue[2*(n+1)].
|
protected int |
size
The number of elements in the priority queue.
|
| Constructor and Description |
|---|
DataFastLookupPriorityQueue(int initialCapacity,
it.unimi.dsi.fastutil.Hash.Strategy<DRecord> strategy,
org.processmining.plugins.astar.petrinet.impl.AbstractPDelegate<? extends nl.tue.astar.Tail> delegate) |
DataFastLookupPriorityQueue(int initialCapacity,
it.unimi.dsi.fastutil.Hash.Strategy<DRecord> strategy,
org.processmining.plugins.astar.petrinet.impl.AbstractPDelegate<? extends nl.tue.astar.Tail> delegate,
int maxCost) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(nl.tue.astar.Record newE)
Inserts the specified element into this priority queue.
|
boolean |
checkInv() |
protected boolean |
checkInv(int loc) |
DRecord |
contains(nl.tue.astar.Record newRec)
Checks if the queue contains a record pointing to the same state as the
given record.
|
boolean |
equals(java.lang.Object o) |
int |
getMaxCost() |
protected void |
grow(int minCapacity)
Increases the capacity of the array.
|
int |
hashCode() |
protected abstract boolean |
isBetter(DRecord r1,
DRecord r2) |
boolean |
isEmpty() |
nl.tue.astar.Record |
peek() |
nl.tue.astar.Record |
poll() |
void |
setMaxCost(int maxCost) |
int |
size() |
java.lang.String |
toString() |
protected final it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap<DRecord> locationMap
protected static final int NEV
protected DRecord[] queue
protected int size
protected int maxCost
public DataFastLookupPriorityQueue(int initialCapacity,
it.unimi.dsi.fastutil.Hash.Strategy<DRecord> strategy,
org.processmining.plugins.astar.petrinet.impl.AbstractPDelegate<? extends nl.tue.astar.Tail> delegate)
public DataFastLookupPriorityQueue(int initialCapacity,
it.unimi.dsi.fastutil.Hash.Strategy<DRecord> strategy,
org.processmining.plugins.astar.petrinet.impl.AbstractPDelegate<? extends nl.tue.astar.Tail> delegate,
int maxCost)
public boolean isEmpty()
isEmpty in interface nl.tue.astar.util.FastLookupPriorityQueuepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic void setMaxCost(int maxCost)
setMaxCost in interface nl.tue.astar.util.FastLookupPriorityQueuepublic int getMaxCost()
getMaxCost in interface nl.tue.astar.util.FastLookupPriorityQueuepublic DRecord contains(nl.tue.astar.Record newRec)
nl.tue.astar.util.FastLookupPriorityQueuecontains in interface nl.tue.astar.util.FastLookupPriorityQueuepublic boolean checkInv()
protected void grow(int minCapacity)
minCapacity - the desired minimum capacitypublic nl.tue.astar.Record peek()
peek in interface nl.tue.astar.util.FastLookupPriorityQueuepublic int size()
size in interface nl.tue.astar.util.FastLookupPriorityQueuepublic nl.tue.astar.Record poll()
poll in interface nl.tue.astar.util.FastLookupPriorityQueuepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean add(nl.tue.astar.Record newE)
add in interface nl.tue.astar.util.FastLookupPriorityQueuetrue (as specified by Collection.add(E))java.lang.ClassCastException - if the specified element cannot be compared with elements
currently in this priority queue according to the priority
queue's orderingjava.lang.NullPointerException - if the specified element is nullprotected boolean checkInv(int loc)