mapss.dif.csdf.bcsdf
Class BCSDFEdgeWeight

java.lang.Object
  extended by mapss.dif.DIFEdgeWeight
      extended by mapss.dif.csdf.CSDFEdgeWeight
          extended by mapss.dif.csdf.bcsdf.BCSDFEdgeWeight
All Implemented Interfaces:
java.lang.Cloneable

public class BCSDFEdgeWeight
extends CSDFEdgeWeight

Information associated with an BCSDF edge. BCSDFEdgeWeights are objects associated with Edges that represent BCSDF edges in Graphs. This class caches frequently-used data associated with BCSDF edges. It is also useful for intermediate BCSDF 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 BCSDF models. The BCSDF production and consumption rates are stored as java.util.BitSet.

Version:
$Id: BCSDFEdgeWeight.java 406 2007-05-10 14:27:07Z plishker $
Author:
Chia-Jui Hsu
See Also:
Edge

Constructor Summary
BCSDFEdgeWeight()
          Construct an edge weight for a homogeneous, zero-delay edge.
BCSDFEdgeWeight(java.util.BitSet productionRates, java.util.BitSet consumptionRates, int delay)
          Construct an edge weight for a specified token production rate, token consumption rate, and delay.
BCSDFEdgeWeight(int[] productionRates, int[] consumptionRates, int delay)
          Construct an edge weight for a specified token production rate, token consumption rate, and delay.
BCSDFEdgeWeight(java.lang.Object sourcePort, java.lang.Object sinkPort, java.util.BitSet productionRates, java.util.BitSet 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 getBCSDFConsumptionRate(int phase)
          Returns the token consumption rate of the specified phase
 int[] getBCSDFConsumptionRates()
          Get BCSDF consumption rates for all phases.
 int getBCSDFProductionRate(int phase)
          Returns the token production rate of the specified phase
 int[] getBCSDFProductionRates()
          Get BCSDF production rates for all phases.
 void setBCSDFConsumptionRate(int phase, boolean consumptionRate)
          Set the token consumption rate of the specified phase
 void setBCSDFConsumptionRate(int phase, int consumptionRate)
          Set the token consumption rate of the specified phase
 void setBCSDFConsumptionRates(java.util.BitSet consBits)
          Set the token consumption rates
 void setBCSDFConsumptionRates(int[] consumptionRates)
          Set the token consumption rates
 void setBCSDFProductionRate(int phase, boolean productionRate)
          Set the token production rate of the specified phase
 void setBCSDFProductionRate(int phase, int productionRate)
          Set the token production rate of the specified phase
 void setBCSDFProductionRates(java.util.BitSet prodBits)
          Set the token production rates
 void setBCSDFProductionRates(int[] productionRates)
          Set the token production rates
 void setConsumptionRate(java.lang.Object consumptionRate)
          Override DIFEdgeWeight.setConsumptionRate(Object) to check the type of input object, and call setBCSDFConsumptionRates(java.util.BitSet) to set the BCSDF consumption rates.
 void setCSDFConsumptionRates(int[] consumptionRates)
          Override CSDFEdgeWeight.setCSDFConsumptionRates(int[]) to prevent illegal usage.
 void setCSDFProductionRates(int[] productionRates)
          Override CSDFEdgeWeight.setCSDFProductionRates(int[]) to prevent illegal usage.
 void setProductionRate(java.lang.Object productionRate)
          Override DIFEdgeWeight.setProductionRate(Object) to check the type of input object, and call setBCSDFProductionRates(int[]) to set the BCSDF production rates.
 java.lang.String toString()
          Return a string representation of the edge weight.
 
Methods inherited from class mapss.dif.csdf.CSDFEdgeWeight
consumptionPeriodRate, consumptionPhaseCount, getCSDFConsumptionRate, getCSDFConsumptionRates, getCSDFProductionRate, getCSDFProductionRates, getIntDelay, productionPeriodRate, productionPhaseCount, setCSDFConsumptionRate, setCSDFProductionRate, setDelay, setDelay
 
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

BCSDFEdgeWeight

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


BCSDFEdgeWeight

public BCSDFEdgeWeight(java.util.BitSet productionRates,
                       java.util.BitSet 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.

BCSDFEdgeWeight

public BCSDFEdgeWeight(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.

BCSDFEdgeWeight

public BCSDFEdgeWeight(java.lang.Object sourcePort,
                       java.lang.Object sinkPort,
                       java.util.BitSet productionRates,
                       java.util.BitSet 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

getBCSDFConsumptionRate

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

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

getBCSDFConsumptionRates

public int[] getBCSDFConsumptionRates()
Get BCSDF consumption rates for all phases.

Returns:
The rates in int[].

getBCSDFProductionRate

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

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

getBCSDFProductionRates

public int[] getBCSDFProductionRates()
Get BCSDF production rates for all phases.

Returns:
The rates in int[].

setBCSDFConsumptionRates

public void setBCSDFConsumptionRates(java.util.BitSet consBits)
Set the token consumption rates

Parameters:
consumptionRates - The token consumption rates as BitSet.

setBCSDFConsumptionRates

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

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

setBCSDFConsumptionRate

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

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

setBCSDFConsumptionRate

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

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

setBCSDFProductionRates

public void setBCSDFProductionRates(java.util.BitSet prodBits)
Set the token production rates

Parameters:
productionRates - The new token production rates as a BitSet.

setBCSDFProductionRates

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

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

setBCSDFProductionRate

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

Parameters:
phase - The phase to modify.
productionRate - The new production rate.

setBCSDFProductionRate

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

Parameters:
phase - The phase to modify.
productionRate - The new production rate.

setConsumptionRate

public void setConsumptionRate(java.lang.Object consumptionRate)
Override DIFEdgeWeight.setConsumptionRate(Object) to check the type of input object, and call setBCSDFConsumptionRates(java.util.BitSet) to set the BCSDF consumption rates.

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

setCSDFConsumptionRates

public void setCSDFConsumptionRates(int[] consumptionRates)
Override CSDFEdgeWeight.setCSDFConsumptionRates(int[]) to prevent illegal usage.

Overrides:
setCSDFConsumptionRates in class CSDFEdgeWeight
Parameters:
consumptionRates -
Throws:
mocgraph.GraphWeightException

setCSDFProductionRates

public void setCSDFProductionRates(int[] productionRates)
Override CSDFEdgeWeight.setCSDFProductionRates(int[]) to prevent illegal usage.

Overrides:
setCSDFProductionRates in class CSDFEdgeWeight
Parameters:
productionRates -
Throws:
mocgraph.GraphWeightException

setProductionRate

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

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

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 CSDFEdgeWeight
Returns:
the string representation of the edge weight.