|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.domains.tm.kernel.TMEvent
public class TMEvent
A TM event is an event that triggers the execution of a TM actor (task). It has the following information that assists the dispatching and processing of the event.
A event queue is used to sort these event, based on
- priority, and - whether it has been startedin that order.
Notice that an interrupt event (an event generated by calling fireAt() of the director) is not a TM event. They are external events that carries time stamps, implemented using the DEEvent class.
DEEvent
Yellow (janneck) |
Yellow (liuj) |
Field Summary | |
---|---|
private Actor |
_actor
|
private boolean |
_hasStarted
|
private int |
_priority
|
private double |
_processingTime
|
private TMReceiver |
_receiver
|
private Token |
_token
|
Constructor Summary | |
---|---|
TMEvent(TMReceiver receiver,
Token token,
int priority,
double processingTime)
Construct an event with the specified destination receiver, token, priority, and executionTime. |
Method Summary | |
---|---|
Actor |
actor()
Return the destination actor for this event. |
int |
compareTo(java.lang.Object event)
Compare the order of this event with the specified event for order. |
int |
compareTo(TMEvent event)
Compare the tag of this event with the specified event for order. |
boolean |
hasStarted()
Return true if the processing of this event has started. |
int |
priority()
Return the priority. |
double |
processingTime()
Return the remaining time needed to finish processing this event. |
TMReceiver |
receiver()
Return the destination receiver of this event. |
void |
setPriority(int newPriority)
Set the priority of the event. |
void |
setProcessingTime(double time)
Set the remaining processing time of the event. |
void |
startProcessing()
Start the processing of this event. |
void |
timeProgress(double time)
Reduce the remaining processing time of this event by a certain amount. |
Token |
token()
Return the token contained by this event. |
java.lang.String |
toString()
Return a description of the event, including the contained token (or "null" if there is none), the priority, the destination actor, whether it has been started, and the remaining processing time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private TMReceiver _receiver
private Actor _actor
private Token _token
private int _priority
private boolean _hasStarted
private double _processingTime
Constructor Detail |
---|
public TMEvent(TMReceiver receiver, Token token, int priority, double processingTime)
receiver
- The destination receiver.token
- The transferred token.priority
- The priority of the port that contains the
destination receiver.processingTime
- The time needed to finish processing the event.
java.lang.NullPointerException
- If the receiver is null or is
not contained by a port contained by an actor.Method Detail |
---|
public final Actor actor()
public final int compareTo(java.lang.Object event)
compareTo
in interface java.lang.Comparable
event
- The event to compare against.
java.lang.ClassCastException
- If the argument is not an instance
of TMEvent.public final int compareTo(TMEvent event)
event
- The event to compare against.
public final boolean hasStarted()
public final int priority()
public final double processingTime()
public final TMReceiver receiver()
public final void setPriority(int newPriority)
newPriority
- The priority set to the event.public final void setProcessingTime(double time)
time
- The remaining processing time.public final void startProcessing()
public final void timeProgress(double time)
time
- The amount of time progressed.public final Token token()
public final java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |