|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.domains.sdf.kernel.SDFUtilities
This class factors code out of the SDF domain, for use in different schedulers, so that they can be implemented in a consistent fashion. This interface contains static methods that are often useful from outside of an SDFDirector, and so are provided here in an interface that can be imported.
| Red (neuendor) |
| Red (neuendor) |
| Nested Class Summary | |
static class |
SDFUtilities.NamedObjComparator
A comparator for named objects. |
| Constructor Summary | |
SDFUtilities()
|
|
| Method Summary | |
protected static int |
_getRate(IOPort port)
Return the number of tokens that will be produced or consumed on the given port. |
static int |
_getRateVariableValue(Port port,
java.lang.String name,
int defaultValue)
Get the integer value stored in the Variable with the specified name. |
protected static void |
_setIfNotDefined(Port port,
java.lang.String name,
int value)
If a variable with the given name does not exist, then create a variable with the given name and set the value of that variable to the specified value. |
protected static void |
_setOrCreate(NamedObj container,
java.lang.String name,
int value)
If the specified container does not contain a variable with the specified name, then create such a variable and set its value to the specified integer. |
protected static void |
_setOrCreate(NamedObj container,
java.lang.String name,
java.lang.String expression)
If the specified container does not contain a variable with the specified name, then create such a variable and set its expression to the specified string. |
protected static void |
_setRate(Port port,
java.lang.String name,
int rate)
Set the rate variable with the specified name to the specified value. |
static Variable |
getRateVariable(Port port,
java.lang.String name)
Get the Variable with the specified name in the given port, or with the specified name preceded by an underscore. |
static int |
getTokenConsumptionRate(IOPort port)
Get the number of tokens that are consumed on the given port. |
static int |
getTokenInitProduction(IOPort port)
Get the number of tokens that are produced on the given port during initialization. |
static int |
getTokenProductionRate(IOPort port)
Get the number of tokens that are produced on the given port. |
static void |
setExpressionIfNotDefined(Port port,
java.lang.String name,
java.lang.String value)
If a variable with the given name does not exist, then create a variable with the given name and set the value of that variable to the specified value. |
static void |
setTokenConsumptionRate(IOPort port,
int rate)
Set the tokenConsumptionRate parameter of the given port to the given rate. |
static void |
setTokenInitProduction(IOPort port,
int rate)
Set the tokenInitProduction parameter of the given port to the given rate. |
static void |
setTokenProductionRate(IOPort port,
int rate)
Set the tokenProductionRate parameter of the given port to the given rate. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SDFUtilities()
| Method Detail |
public static Variable getRateVariable(Port port,
java.lang.String name)
throws IllegalActionException
port - The port.name - The name of the variable.
IllegalActionException
public static int getTokenConsumptionRate(IOPort port)
throws IllegalActionException
IllegalActionException - If the tokenConsumptionRate
parameter has an invalid expression.
public static int getTokenInitProduction(IOPort port)
throws IllegalActionException
IllegalActionException - If the tokenInitProduction
parameter has an invalid expression.
public static int getTokenProductionRate(IOPort port)
throws IllegalActionException
IllegalActionException - If the tokenProductionRate
parameter has an invalid expression.
public static void setTokenConsumptionRate(IOPort port,
int rate)
throws IllegalActionException
IllegalActionException - If the rate is negative.
public static void setTokenInitProduction(IOPort port,
int rate)
throws IllegalActionException
IllegalActionException - If the rate is negative.
public static void setTokenProductionRate(IOPort port,
int rate)
throws IllegalActionException
IllegalActionException - If the rate is negative.
protected static int _getRate(IOPort port)
throws NotSchedulableException,
IllegalActionException
NotSchedulableException - If the port is both an input and
an output, or is neither an input nor an output.
IllegalActionException - If a rate does not contain a
valid expression.
public static int _getRateVariableValue(Port port,
java.lang.String name,
int defaultValue)
throws IllegalActionException
port - The port.name - The name of the variable.defaultValue - The default value of the variable.
IllegalActionException
protected static void _setIfNotDefined(Port port,
java.lang.String name,
int value)
throws IllegalActionException
port - The port.name - Name of the variable.value - The value.
IllegalActionException
public static void setExpressionIfNotDefined(Port port,
java.lang.String name,
java.lang.String value)
throws IllegalActionException
port - The port.name - Name of the variable.value - The value.
IllegalActionException
protected static void _setOrCreate(NamedObj container,
java.lang.String name,
int value)
throws IllegalActionException
container - The container.name - Name of the variable.value - The value.
If - the variable exists and its value cannot be set.
IllegalActionException
protected static void _setOrCreate(NamedObj container,
java.lang.String name,
java.lang.String expression)
throws IllegalActionException
container - The container.name - Name of the variable.expression - The expression.
If - the variable exists and its value cannot be set.
IllegalActionException
protected static void _setRate(Port port,
java.lang.String name,
int rate)
throws IllegalActionException
port - The port.name - The variable name.rate - The rate value.
IllegalActionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||