Package org.simplesim.examples.testing
Class EventQueueTest
java.lang.Object
org.simplesim.examples.testing.EventQueueTest
Performance test and comparison of various implementations of
EventQueue
All methods of the event queue are tested and evaluated. The size of the queue and number of test
are adjusted by changing the countXXX
constants.
-
Constructor Summary
ConstructorsConstructorDescriptionEventQueueTest
(org.simplesim.examples.testing.EventQueueTest.QueueType queueType) -
Method Summary
Modifier and TypeMethodDescriptionlong
Test for dequeuing all current eventslong
Test for requeuing the current eventlong
Test for look-up operations of an event queuestatic void
long
Initializes the event queue withcountTotal
events
-
Constructor Details
-
EventQueueTest
public EventQueueTest(org.simplesim.examples.testing.EventQueueTest.QueueType queueType)
-
-
Method Details
-
populateEventQueue
public long populateEventQueue()Initializes the event queue withcountTotal
events -
doRequeueNextEvent
public long doRequeueNextEvent()Test for requeuing the current eventDequeues the current event and enqueues it again with a new time stamp, using
dequeue()
andenqueue(Time,E)
functionality. Does not change the size of the queue. -
doSearchAndDequeueEvent
public long doSearchAndDequeueEvent()Test for look-up operations of an event queueSearches for an event and requeues it with a new time stamp, using
getTime(E)
,dequeue(E)
andenqueue(Time,E)
functionality. Decreases the size of the queue bycountSADE
events. -
doDequeueAllNextEvents
public long doDequeueAllNextEvents()Test for dequeuing all current eventsDequeues the all current events with the same time stamp, using
dequeueAll()
functionality. The event queue will be empty after this method. -
main
- Parameters:
args
-
-