DDEReceivers each have three important variables: receiver time, last time and priority. The receiver time of a DDEReceiver is equal to the time of the oldest event that resides in the receiver. The last time is equal to the time of the newest event residing on the receiver.
A TimeKeeper manages the DDEReceivers of its actor by keeping track of the receiver with the minimum receiver time. The actor is allowed to consume a token from a receiver if that receiver has the unique, minimum receiver time of all receivers managed by the TimeKeeper. The TimeKeeper keeps track of its receivers' priorities as well. The receiver with the highest priority is enabled to have its token consumed if the receiver shares a common minimum receive time with one or more additional receivers.
The receiver priorities are set using the method _setReceiverPriorities() in the following manner. All of the input receivers associated with a given TimeKeeper are prioritized according to the inverse order in which they were connected in the model topology. I.e., if two input receivers (rA and rB) of an actor are connected such that receiver rA is connected before receiver rB, then rB will have a higher priority than rA.
The above approach provides each receiver associated with a given TimeKeeper with a unique priority, such that the set of receiver priorities of the associated TimeKeeper is totally ordered.
A TimeKeeper manages the ordering of receivers by keeping track of its receivers and their corresponding receiver times and priorities. As tokens are placed in and taken out of the receivers of an actor, the TimeKeeper's receiver list is updated. The receiver list is sorted by ReceiverComparator. This same information allows the TimeKeeper to determine what the current time is local to the actor. @author John S. Davis II @version $Id: TimeKeeper.java,v 1.99 2006/02/16 13:34:24 cxh Exp $ @since Ptolemy II 0.3 @Pt.ProposedRating Green (davisj) @Pt.AcceptedRating Green (kienhuis) @see ptolemy.domains.dde.kernel.DDEThread
|
|
|
|
|
|
|
|