mapss.dif.csdf
Class CSDFEdgeWeight

java.lang.Object
  extended by mapss.dif.DIFEdgeWeight
      extended by mapss.dif.csdf.CSDFEdgeWeight
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BCSDFEdgeWeight, SDFEdgeWeight

public class CSDFEdgeWeight
extends DIFEdgeWeight
implements java.lang.Cloneable

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

Version:
$Id: CSDFEdgeWeight.java 406 2007-05-10 14:27:07Z plishker $
Author:
Michael Rinehart, Shuvra S. Bhattacharyya, Chia-Jui Hsu
See Also:
Edge

Constructor Summary
CSDFEdgeWeight()
          Construct an edge weight for a homogeneous, zero-delay edge.
CSDFEdgeWeight(int[] productionRates, int[] consumptionRates, int delay)
          Construct an edge weight for a specified token production rate, token consumption rate, and delay.
CSDFEdgeWeight(java.lang.Object sourcePort, java.lang.Object sinkPort, int[] productionRates, int[] consumptionRates, int delay)
          Construct an edge weight for a specified source port, sink port, token production rate, token consumption rate, and delay.
 
Method Summary
 int consumptionPeriodRate()
          The sum of the token consumption rates over all phases is returned.
 int consumptionPhaseCount()
          Returns the number of the phases on the consumed end of the edge
 int getCSDFConsumptionRate(int phase)
          Returns the token consumption rate of the specified phase
 int[] getCSDFConsumptionRates()
          Get CSDF consumption rates for all phases.
 int getCSDFProductionRate(int phase)
          Returns the token production rate of the specified phase
 int[] getCSDFProductionRates()
          Get CSDF production rates for all phases.
 int getIntDelay()
          Get integer delay value on this edge.
 int productionPeriodRate()
          The sum of the token production rates over all phases is returned.
 int productionPhaseCount()
          Returns the number of the phases on the produced end of the edge
 void setConsumptionRate(java.lang.Object consumptionRate)
          Override DIFEdgeWeight.setConsumptionRate(Object) to check the type of input object, and call setCSDFConsumptionRates(int[]) to set the CSDF consumption rates.
 void setCSDFConsumptionRate(int phase, int consumptionRate)
          Set the token consumption rate of the specified phase
 void setCSDFConsumptionRates(int[] consumptionRates)
          Set the token consumption rates
 void setCSDFProductionRate(int phase, int productionRate)
          Set the token production rate of the specified phase
 void setCSDFProductionRates(int[] productionRates)
          Set the token production rates
 void setDelay(int delay)
          Set the delay of the associated CSDF edge.
 void setDelay(java.lang.Object delay)
          Set the delay of the associated CSDF edge.
 void setProductionRate(java.lang.Object productionRate)
          Override DIFEdgeWeight.setProductionRate(Object) to check the type of input object, and call setCSDFProductionRates(int[]) to set the CSDF production rates.
 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, setSinkPort, setSourcePort
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CSDFEdgeWeight

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


CSDFEdgeWeight

public CSDFEdgeWeight(int[] productionRates,
                      int[] consumptionRates,
                      int delay)
Construct an edge weight for a specified token production rate, token consumption rate, and delay.

Parameters:
productionRates - The token production rates.
consumptionRates - The token consumption rates.
delay - The delay.

CSDFEdgeWeight

public CSDFEdgeWeight(java.lang.Object sourcePort,
                      java.lang.Object sinkPort,
                      int[] productionRates,
                      int[] consumptionRates,
                      int 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.
productionRates - The token production rates.
consumptionRates - The token consumption rates.
delay - The delay.
Method Detail

consumptionPeriodRate

public int consumptionPeriodRate()
The sum of the token consumption rates over all phases is returned.

Returns:
The period token consumption rate.

consumptionPhaseCount

public int consumptionPhaseCount()
Returns the number of the phases on the consumed end of the edge

Returns:
The number of phases on the consumed end of the edge.

getCSDFConsumptionRate

public int getCSDFConsumptionRate(int phase)
Returns the token consumption rate of the specified phase

Parameters:
phase - The phase.
Returns:
The token consumption rate.

getCSDFConsumptionRates

public int[] getCSDFConsumptionRates()
Get CSDF consumption rates for all phases.

Returns:
The rates in int[].

getCSDFProductionRate

public int getCSDFProductionRate(int phase)
Returns the token production rate of the specified phase

Parameters:
phase - The phase.
Returns:
The token production rate.

getCSDFProductionRates

public int[] getCSDFProductionRates()
Get CSDF production rates for all phases.

Returns:
The rates in int[].

getIntDelay

public int getIntDelay()
Get integer delay value on this edge.

Returns:
Integer delay value.

productionPeriodRate

public int productionPeriodRate()
The sum of the token production rates over all phases is returned.

Returns:
The period token production rate.

productionPhaseCount

public int productionPhaseCount()
Returns the number of the phases on the produced end of the edge

Returns:
The number of phases on the produced end of the edge.

setConsumptionRate

public void setConsumptionRate(java.lang.Object consumptionRate)
Override DIFEdgeWeight.setConsumptionRate(Object) to check the type of input object, and call setCSDFConsumptionRates(int[]) to set the CSDF consumption rates.

Overrides:
setConsumptionRate in class DIFEdgeWeight
Parameters:
consumptionRate - The new token consumption rates.
Throws:
mocgraph.GraphWeightException - If the input object is not instanceof int[].

setCSDFConsumptionRates

public void setCSDFConsumptionRates(int[] consumptionRates)
Set the token consumption rates

Parameters:
consumptionRates - The new token consumption rates as an array.

setCSDFConsumptionRate

public void setCSDFConsumptionRate(int phase,
                                   int consumptionRate)
Set the token consumption rate of the specified phase

Parameters:
phase - The phase to modify.
consumptionRate - The new consumption rate.

setCSDFProductionRates

public void setCSDFProductionRates(int[] productionRates)
Set the token production rates

Parameters:
productionRates - The new token production rates as an array.

setCSDFProductionRate

public void setCSDFProductionRate(int phase,
                                  int productionRate)
Set the token production rate of the specified phase

Parameters:
phase - The phase to modify.
productionRate - The new token production rates.

setDelay

public void setDelay(int delay)
Set the delay of the associated CSDF edge.

Parameters:
delay - An integer number.

setDelay

public void setDelay(java.lang.Object delay)
Set the delay of the associated CSDF edge.

Overrides:
setDelay in class DIFEdgeWeight
Parameters:
delay - The new Integer delay object.
Throws:
mocgraph.GraphWeightException - If runtime type of delay is not Integer.

setProductionRate

public void setProductionRate(java.lang.Object productionRate)
Override DIFEdgeWeight.setProductionRate(Object) to check the type of input object, and call setCSDFProductionRates(int[]) to set the CSDF production rates.

Overrides:
setProductionRate in class DIFEdgeWeight
Parameters:
productionRate - The new token production rates.
Throws:
mocgraph.GraphWeightException - If the input object is not instanceof int[].

toString

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

[productionRate1 productionRate2 ...] [consumptionRate1 consumptionRate2 ...] delay

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