Class EventQueueTest

java.lang.Object
org.simplesim.examples.testing.EventQueueTest

public class EventQueueTest extends Object
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 Details

    • EventQueueTest

      public EventQueueTest(org.simplesim.examples.testing.EventQueueTest.QueueType queueType)
  • Method Details

    • populateEventQueue

      public long populateEventQueue()
      Initializes the event queue with countTotal events
    • doRequeueNextEvent

      public long doRequeueNextEvent()
      Test for requeuing the current event

      Dequeues the current event and enqueues it again with a new time stamp, using dequeue() and enqueue(Time,E) functionality. Does not change the size of the queue.

    • doSearchAndDequeueEvent

      public long doSearchAndDequeueEvent()
      Test for look-up operations of an event queue

      Searches for an event and requeues it with a new time stamp, using getTime(E), dequeue(E) and enqueue(Time,E) functionality. Decreases the size of the queue by countSADE events.

    • doDequeueAllNextEvents

      public long doDequeueAllNextEvents()
      Test for dequeuing all current events

      Dequeues the all current events with the same time stamp, using dequeueAll() functionality. The event queue will be empty after this method.

    • main

      public static void main(String[] args)
      Parameters:
      args -