Class HistoricalPriorityQueue<E>
java.lang.Object
org.opentrafficsim.core.perception.AbstractHistorical<E,AbstractHistoricalCollection.EventCollection<E,C>>
org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection<E,Q>
org.opentrafficsim.core.perception.collections.AbstractHistoricalQueue<E,PriorityQueue<E>>
org.opentrafficsim.core.perception.collections.HistoricalPriorityQueue<E>
- Type Parameters:
E- element type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>,HistoricalCollection<E>,HistoricalQueue<E>,HistoryManager.HistoricalElement
public class HistoricalPriorityQueue<E> extends AbstractHistoricalQueue<E,PriorityQueue<E>>
PriorityQueue-valued historical state. The current priority queue is always maintained, and past states of the priority queue
are obtained by applying the events between now and the requested time in reverse.
The
The
Iterator returned by this class does not support the remove(), add() and set() methods.
Any returned sublist is unmodifiable.
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 4 feb. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection
AbstractHistoricalCollection.AddEvent<E,C extends Collection<E>>, AbstractHistoricalCollection.EventCollection<E,C extends Collection<E>>, AbstractHistoricalCollection.RemoveEvent<E,C extends Collection<E>>Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.AbstractHistorical
AbstractHistorical.EventValue<T> -
Constructor Summary
Constructors Constructor Description HistoricalPriorityQueue(HistoryManager historyManager)Constructor.HistoricalPriorityQueue(HistoryManager historyManager, Collection<? extends E> c)Constructor. -
Method Summary
Modifier and Type Method Description PriorityQueue<E>get()Returns the current queue.PriorityQueue<E>get(Time time)Returns a past queue.StringtoString()Methods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalQueue
element, offer, peek, poll, removeMethods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection
add, addAll, clear, contains, containsAll, fill, fill, getCollection, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArrayMethods inherited from class org.opentrafficsim.core.perception.AbstractHistorical
addEvent, cleanUpHistory, getEvent, getEvents, getLastEvent, isLastState, now, removeEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalCollection
removeIf
-
Constructor Details
-
HistoricalPriorityQueue
Constructor.- Parameters:
historyManager- HistoryManager; history manager
-
HistoricalPriorityQueue
Constructor.- Parameters:
historyManager- HistoryManager; history managerc- Collection<? extends E>; initial collection
-
-
Method Details