Patent ID: 7562367

Claim:
An apparatus having a processor for managing an event queue for a simulation comprising a plurality of events each scheduled to occur at a respective event time, the apparatus comprising: a tree generator adapted to generate a sorted tree data structure comprising a plurality of nodes, wherein each of the nodes in the sorted tree data structure corresponds to only one of the event times associated with the events scheduled to occur, and wherein the nodes of the sorted tree data structure are sorted according to the event times of the nodes; a record generator adapted to generate an event record for each event; and an association unit adapted to associate the event records with the nodes so that each of the event records is associated with the one of the nodes corresponding to the event time at which the respective event is scheduled to occur, wherein: the record generator is further adapted to generate a new event record for a new event; and the association unit is further adapted to associate the new event record with a node of the sorted tree data structure that corresponds to an event time at which the new event is scheduled to occur, wherein the tree generator is further adapted to: determine whether a node of the sorted tree data structure exists that corresponds to the event time at which the new event is scheduled to occur; and generate the node corresponding to the event time at which the new event is scheduled to occur when no node exists that corresponds to the event time at which the new event is scheduled to occur, and wherein the association unit, when no node exists that corresponds to the event time at which the new event is scheduled to occur, is further adapted to: generate a linked list comprising the new event record; and associate the linked list with the node corresponding to the event time at which the new event is scheduled to occur.