public class PtidesEvent extends DEEvent
DEEvent
.
However, scheduling in Ptides is more flexible than in DE. In
order to support this flexibility, fields such as token, receiver,
and absoluteDeadline are added.
A Ptides event can be of two kinds. A pure event, or a non-pure (trigger) event. For all pure events, the absolute deadline of this event is saved. For all non-pure events, the token as well as the destination receiver is saved. These information are saved in addition to the information that is stored in the super class, such as the timestamp, etc. This class is used in the Ptides domain.
Note in PtidesEvent, unlike DEEvent, the ioPort parameter is overloaded. If the event is not a pure event, then ioPort indicate the destination port for this event. However, if the event is a pure event, then ioPort is the source input port for this event.
The semantics of equals() and compareTo() in this method are tricky. equals() indicates two Ptides events are equal if all fields in this class and the superclass are equal (including absoluteDeadline, token, channel, and receiver, etc). However, the compareTo() method does not override that of the super class. The semantics of the compareTo() is such that two events are equal if the timestamps, microstep, depth, and priority fields indicate they are equal. Note CompareTo() should be called by Ptides directors that try to order events based on event's timestamps. If the Ptides director wishes to order events based on deadlines, it should check event deadlines first. Only in the case when deadlines of events are equal, should compareTo() be called.
Red (jiazou) |
Yellow (jiazou) |
_actor, _depth, _ioPort, _microstep, _priority, _timestamp
Constructor and Description |
---|
PtidesEvent(Actor actor,
IOPort ioPort,
Time timeStamp,
int microstep,
int depth,
Time absoluteDeadline,
Time sourceTimestamp)
Construct a pure event with the specified destination actor,
timestamp, microstep, depth, and absoluteDeadline.
|
PtidesEvent(IOPort ioPort,
int channel,
Time timeStamp,
int microstep,
int depth,
Token token,
Receiver receiver,
Time sourceTimestamp)
Construct a trigger event with the specified destination IO port,
timestamp, microstep, and depth.
|
PtidesEvent(IOPort ioPort,
int channel,
Time timeStamp,
int microstep,
int depth,
Token token,
Receiver receiver,
Time deadline,
Time sourceTimestamp)
Construct a trigger event with the specified destination IO port,
timestamp, microstep, and depth.
|
Modifier and Type | Method and Description |
---|---|
Time |
absoluteDeadline()
Return the absolute deadline of this event if the event is a
pure event.
|
int |
channel()
Return the destination channel for this event.
|
boolean |
equals(java.lang.Object object)
Indicate whether some other object is equal to this PtidesEvent.
|
int |
hashCode()
Return the hash code for the event object.
|
boolean |
hasTheSameTagAs(DEEvent event)
Return true if this event has the same tag as the argument DE event.
|
boolean |
isPureEvent()
Return true if this event is a pure event.
|
Receiver |
receiver()
Return the destination receiver for this event.
|
Time |
sourceTimestamp()
Timestamp of the event on the source platform.
|
Token |
token()
Return the token (value) of this event.
|
java.lang.String |
toString()
Return a description of the event, including the the tag, depth,
the token, absolute deadline, and destination information.
|
public PtidesEvent(Actor actor, IOPort ioPort, Time timeStamp, int microstep, int depth, Time absoluteDeadline, Time sourceTimestamp) throws IllegalActionException
actor
- The destination actorioPort
- The causally related IO port.timeStamp
- The time when the event occurs.microstep
- The phase of execution within a fixed time.depth
- The topological depth of the destination actor.absoluteDeadline
- The absolute deadline of this pure event.
This field should not be null.sourceTimestamp
- The timestamp of the event on the source platform.IllegalActionException
- If the actor has a priority parameter,
but its value cannot be obtained, which should be an integer.public PtidesEvent(IOPort ioPort, int channel, Time timeStamp, int microstep, int depth, Token token, Receiver receiver, Time sourceTimestamp) throws IllegalActionException
ioPort
- The destination IO port.channel
- The channel the event is destined to.timeStamp
- The time when the event occurs.microstep
- The phase of execution within a fixed time.depth
- The topological depth of the destination IO Port.token
- The token associated with the event. This field should
not be null.receiver
- The Receiver the event is destined to. This field
should not be null.sourceTimestamp
- The timestamp of the event on the source platform.IllegalActionException
- If the actor has a priority parameter,
but its value cannot be obtained, which should be an integer.public PtidesEvent(IOPort ioPort, int channel, Time timeStamp, int microstep, int depth, Token token, Receiver receiver, Time deadline, Time sourceTimestamp) throws IllegalActionException
ioPort
- The destination IO port.channel
- The channel the event is destined to.timeStamp
- The time when the event occurs.microstep
- The phase of execution within a fixed time.depth
- The topological depth of the destination IO Port.token
- The token associated with the event. This field should
not be null.receiver
- The Receiver the event is destined to. This field
should not be null.deadline
- Time when the event has to be processed.sourceTimestamp
- The timestamp of the event on the source platform.IllegalActionException
- If the actor has a priority parameter,
but its value cannot be obtained, which should be an integer.public final Time absoluteDeadline()
InternalErrorException
- If event is not a pure event,
or the event is a pure event and absoluteDeadline is null.public final int channel()
public boolean equals(java.lang.Object object)
equals
in class DEEvent
object
- The object with which to compare.hashCode()
public int hashCode()
hashCode
in class DEEvent
equals(Object)
public boolean hasTheSameTagAs(DEEvent event)
DEEvent
hasTheSameTagAs
in class DEEvent
event
- The DE event to compare against.public final boolean isPureEvent()
public final Receiver receiver()
public final Time sourceTimestamp()
public final Token token()
InternalErrorException
- If event is not a pure event
and token field is null.