mapss.dif.psdf
Class PSDFEdgeWeight

java.lang.Object
  extended by mapss.dif.DIFEdgeWeight
      extended by mapss.dif.psdf.PSDFEdgeWeight
All Implemented Interfaces:
java.lang.Cloneable

public class PSDFEdgeWeight
extends DIFEdgeWeight

Information associated with a PSDF edge. PSDFEdgeWeights are objects associated with Edges that represent PSDF edges in Graphs. This class caches frequently-used data associated with PSDF edges. It is also useful for intermediate PSDF graph representations that do not correspond to Ptolemy II models, and performing graph analyses (e.g., quasi-static scheduling). It is intended for use with analysis/synthesis algorithms that operate on generic graph representations of PSDF models.

Production and consumption rate objects, as well as delay objects, in PSDFEdgeWeights are of type Variable. They give the symoblic expressions (or constant expressions) that correspond to the data rates on the associated ports. By default, a PSDF edge weight contains production and consumption rates that are equal to unity, and a zero-valued delay.

Version:
$Id: PSDFEdgeWeight.java 409 2007-05-13 19:47:16Z plishker $
Author:
Shuvra S. Bhattacharyya
See Also:
Edge, CSDFEdgeWeight

Constructor Summary
PSDFEdgeWeight()
          Construct an edge weight for a homogeneous, zero-delay edge.
PSDFEdgeWeight(java.lang.Object sourcePort, java.lang.Object sinkPort, ptolemy.data.expr.Variable productionRate, ptolemy.data.expr.Variable consumptionRate, ptolemy.data.expr.Variable delay)
          Construct an edge weight for a specified source port, sink port, token production rate, token consumption rate, and delay.
PSDFEdgeWeight(ptolemy.data.expr.Variable productionRate, ptolemy.data.expr.Variable consumptionRate, ptolemy.data.expr.Variable delay)
          Construct an edge weight for a specified token production rate, token consumption rate, and delay.
 
Method Summary
 java.lang.String getConsumptionRateExpression()
          Get the expression associated with the token consumption rate of the PSDF edge.
 java.lang.String getProductionRateExpression()
          Get the expression associated with the token production rate of the PSDF edge.
 ptolemy.data.expr.Variable getPSDFConsumptionRate()
          Get the token consumption rate of the associated PSDF edge.
 ptolemy.data.expr.Variable getPSDFDelay()
          Get the delay of the associated PSDF edge.
 ptolemy.data.expr.Variable getPSDFProductionRate()
          Get the token production rate of the associated PSDF edge.
 void setConsumptionRateExpression(java.lang.String expression)
          Set to a given expression value the expression associated with the token consumption rate of the PSDF edge.
 void setProductionRateExpression(java.lang.String expression)
          Set to a given expression value the expression associated with the token production rate of the PSDF edge.
 void setPSDFConsumptionRate(ptolemy.data.expr.Variable consumptionRate)
          Set the token consumption rate of the PSDF edge to the given variable.
 void setPSDFDelay(ptolemy.data.expr.Variable delay)
          Set the delay of the PSDF edge to the given variable.
 void setPSDFProductionRate(ptolemy.data.expr.Variable productionRate)
          Set the token production rate of the PSDF edge to the given variable.
 java.lang.String toString()
          Return a string representation of the edge weight.
 
Methods inherited from class mapss.dif.DIFEdgeWeight
_getConsumptionRate, _getDelay, _getProductionRate, _setConsumptionRate, _setDelay, _setProductionRate, clone, getConsumptionRate, getDelay, getProductionRate, getSinkPort, getSourcePort, setConsumptionRate, setDelay, setProductionRate, setSinkPort, setSourcePort
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PSDFEdgeWeight

public PSDFEdgeWeight()
Construct an edge weight for a homogeneous, zero-delay edge. Production and consumption values are set to 1.


PSDFEdgeWeight

public PSDFEdgeWeight(ptolemy.data.expr.Variable productionRate,
                      ptolemy.data.expr.Variable consumptionRate,
                      ptolemy.data.expr.Variable delay)
Construct an edge weight for a specified token production rate, token consumption rate, and delay.

Parameters:
productionRate - The token production rate.
consumptionRate - The token consumption rate.
delay - The delay.

PSDFEdgeWeight

public PSDFEdgeWeight(java.lang.Object sourcePort,
                      java.lang.Object sinkPort,
                      ptolemy.data.expr.Variable productionRate,
                      ptolemy.data.expr.Variable consumptionRate,
                      ptolemy.data.expr.Variable delay)
Construct an edge weight for a specified source port, sink port, token production rate, token consumption rate, and delay. The source port and sink port are ports that correspond to this edge.

Parameters:
sourcePort - The source port.
sinkPort - The sink port.
productionRate - The token production rate.
consumptionRate - The token consumption rate.
delay - The delay.
Method Detail

getPSDFConsumptionRate

public ptolemy.data.expr.Variable getPSDFConsumptionRate()
Get the token consumption rate of the associated PSDF edge.

Returns:
The consumption rate.

getPSDFDelay

public ptolemy.data.expr.Variable getPSDFDelay()
Get the delay of the associated PSDF edge.

Returns:
The delay.

getPSDFProductionRate

public ptolemy.data.expr.Variable getPSDFProductionRate()
Get the token production rate of the associated PSDF edge.

Returns:
The production rate.

getConsumptionRateExpression

public java.lang.String getConsumptionRateExpression()
Get the expression associated with the token consumption rate of the PSDF edge. This expression is used by schedulers to keep track of changes in consumption rates as graphs are clustered.

Returns:
Token consumption rate expression.
See Also:
setConsumptionRateExpression(String).

getProductionRateExpression

public java.lang.String getProductionRateExpression()
Get the expression associated with the token production rate of the PSDF edge. This expression is used by schedulers to keep track of changes in production rates as graphs are clustered.

Returns:
The token production rate expression.
See Also:
setProductionRateExpression(String).

setPSDFConsumptionRate

public void setPSDFConsumptionRate(ptolemy.data.expr.Variable consumptionRate)
Set the token consumption rate of the PSDF edge to the given variable.

Parameters:
consumptionRate - The given variable.

setPSDFDelay

public void setPSDFDelay(ptolemy.data.expr.Variable delay)
Set the delay of the PSDF edge to the given variable.

Parameters:
delay - The given variable.

setPSDFProductionRate

public void setPSDFProductionRate(ptolemy.data.expr.Variable productionRate)
Set the token production rate of the PSDF edge to the given variable.

Parameters:
productionRate - The given variable.

setConsumptionRateExpression

public void setConsumptionRateExpression(java.lang.String expression)
Set to a given expression value the expression associated with the token consumption rate of the PSDF edge.

Parameters:
expression - The given expression value.
See Also:
getConsumptionRateExpression().

setProductionRateExpression

public void setProductionRateExpression(java.lang.String expression)
Set to a given expression value the expression associated with the token production rate of the PSDF edge.

Parameters:
expression - The given expression value.
See Also:
getProductionRateExpression().

toString

public java.lang.String toString()
Return a string representation of the edge weight. This string representation is in the following form:

productionRate consumptionRate delay

Overrides:
toString in class DIFEdgeWeight
Returns:
The string representation of the edge weight.