Package ptolemy.domains.tdl.kernel
Class TDLAction
- java.lang.Object
-
- ptolemy.domains.tdl.kernel.TDLAction
-
public class TDLAction extends java.lang.Object
A TDL action. Used in the TDLActionsGraph.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Patricia Derler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TDLAction.TDLActionComparator
A class that compares two TDL actions.
-
Field Summary
Fields Modifier and Type Field Description int
actionType
Type of TDL action.static int
AFTERMODESWITCH
If a mode switch is not taken, this is the next action.static int
AFTERTASKOUTPUTS
The action after a task is output.static int
EXECUTETASK
Execute a task.static int
MODESWITCH
Test a mode switch guard and execute the mode switch if the guard evaluates to true.java.lang.Object
object
Actor the TDL action has to be performed on.static int
READINPUT
Read the input of a task.static int
READSENSOR
Read a sensor value which is the input of a TDLModule.Time
time
Time stamp for the TDL action.static int
WRITEACTUATOR
Write actuator which is the output of a TDLModule.static int
WRITEOUTPUT
Write output of a task.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
Return a hash code value for this action.boolean
sameActionAs(TDLAction action, Time modePeriod)
Return true if two actions are the same.java.lang.String
toString()
-
-
-
Field Detail
-
WRITEOUTPUT
public static final int WRITEOUTPUT
Write output of a task.- See Also:
- Constant Field Values
-
WRITEACTUATOR
public static final int WRITEACTUATOR
Write actuator which is the output of a TDLModule.- See Also:
- Constant Field Values
-
MODESWITCH
public static final int MODESWITCH
Test a mode switch guard and execute the mode switch if the guard evaluates to true.- See Also:
- Constant Field Values
-
AFTERMODESWITCH
public static final int AFTERMODESWITCH
If a mode switch is not taken, this is the next action. It does not do anything but is required for the TDL ActionsGraph.- See Also:
- Constant Field Values
-
READSENSOR
public static final int READSENSOR
Read a sensor value which is the input of a TDLModule.- See Also:
- Constant Field Values
-
READINPUT
public static final int READINPUT
Read the input of a task.- See Also:
- Constant Field Values
-
EXECUTETASK
public static final int EXECUTETASK
Execute a task.- See Also:
- Constant Field Values
-
AFTERTASKOUTPUTS
public static final int AFTERTASKOUTPUTS
The action after a task is output.- See Also:
- Constant Field Values
-
time
public Time time
Time stamp for the TDL action.
-
actionType
public int actionType
Type of TDL action. This is one of the constants defined above.
-
object
public java.lang.Object object
Actor the TDL action has to be performed on.
-
-
Constructor Detail
-
TDLAction
public TDLAction(Time time, int actionType, java.lang.Object actor)
Create a new TDLGraphNode.- Parameters:
time
- Time stamp the TDL action has to be done at.actionType
- Type of TDL action.actor
- Actor on which the TDL action has to be performed on.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Return a hash code value for this action.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hash code value for this token.
-
sameActionAs
public boolean sameActionAs(TDLAction action, Time modePeriod)
Return true if two actions are the same.- Parameters:
action
- The action to compare against this actionmodePeriod
- The mode period.- Returns:
- true if the times are equal (==), the TDL actions are equal (==) and the action times are equal (==).
-
-