mapss.dif.bdf
Class BDFEdgeWeight

java.lang.Object
  extended by mapss.dif.DIFEdgeWeight
      extended by mapss.dif.bdf.BDFEdgeWeight
All Implemented Interfaces:
java.lang.Cloneable

public class BDFEdgeWeight
extends DIFEdgeWeight

Information associated with an BDF edge. BDFEdgeWeights are objects associated with Edges that represent BDF edges in Graphs. This class caches frequently-used data associated with BDF edges.

The BDF edge production and consumption rate can have two types. One is regular edge rate, which is represented in positive int or Integer. The other one is boolean edge rate, which is represented as [true rate, false rate] in int[].

Version:
$Id: BDFEdgeWeight.java 409 2007-05-13 19:47:16Z plishker $
Author:
Chia-Jui Hsu
See Also:
Edge

Constructor Summary
BDFEdgeWeight()
          Construct an edge weight for a regular, homogeneous, zero-delay edge.
BDFEdgeWeight(java.lang.Object productionRate, java.lang.Object consumptionRate, int delay)
          Construct an edge weight for a specified token production rate, token consumption rate, and delay.
BDFEdgeWeight(java.lang.Object sourcePort, java.lang.Object sinkPort, java.lang.Object productionRate, java.lang.Object consumptionRate, int delay)
          Construct an edge weight for a specified source port, sink port, token production rate, token consumption rate, and delay.
 
Method Summary
 java.lang.Object getBDFConsumptionRate()
          Get the token consumption rate of the associated BDF edge.
 java.lang.Object getBDFProductionRate()
          Get the token production rate of the associated BDF edge.
 int getIntDelay()
          Get the delay of the associated BDF edge.
 void setBDFConsumptionRate(int consumptionRate)
          Set the token consumption rate of a regular BDF edge.
 void setBDFConsumptionRate(int[] consumptionRate)
          Set the token consumption rate of a boolean BDF edge.
 void setBDFProductionRate(int productionRate)
          Set the token production rate of a regular BDF edge.
 void setBDFProductionRate(int[] productionRate)
          Set the token production rate of a boolean BDF edge.
 void setConsumptionRate(java.lang.Object consumptionRate)
          Override DIFEdgeWeight.setConsumptionRate(Object) to check the type of input object, and call setBDFConsumptionRate(int[]) to set the boolean consumption rate or setBDFConsumptionRate(int) to set the regular consumption rate.
 void setDelay(int delay)
          Set delay of a BDF edge.
 void setProductionRate(java.lang.Object productionRate)
          Override DIFEdgeWeight.setProductionRate(Object) to check the type of input object, and call setBDFProductionRate(int[]) to set the boolean consumption rate or setBDFProductionRate(int) to set the regular consumption rate.
 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, setDelay, setSinkPort, setSourcePort
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BDFEdgeWeight

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


BDFEdgeWeight

public BDFEdgeWeight(java.lang.Object productionRate,
                     java.lang.Object consumptionRate,
                     int 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.

BDFEdgeWeight

public BDFEdgeWeight(java.lang.Object sourcePort,
                     java.lang.Object sinkPort,
                     java.lang.Object productionRate,
                     java.lang.Object consumptionRate,
                     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.
productionRate - The token production rate.
consumptionRate - The token consumption rate.
delay - The delay.
Method Detail

getBDFConsumptionRate

public java.lang.Object getBDFConsumptionRate()
Get the token consumption rate of the associated BDF edge.

Returns:
The consumption rate.

getBDFProductionRate

public java.lang.Object getBDFProductionRate()
Get the token production rate of the associated BDF edge.

Returns:
The production rate.

getIntDelay

public int getIntDelay()
Get the delay of the associated BDF edge.

Returns:
The delay.

setBDFConsumptionRate

public void setBDFConsumptionRate(int consumptionRate)
Set the token consumption rate of a regular BDF edge.

Parameters:
consumptionRate - The token consumption rate in int
Throws:
mocgraph.GraphWeightException - If the consumptionRate is not positive.

setBDFConsumptionRate

public void setBDFConsumptionRate(int[] consumptionRate)
Set the token consumption rate of a boolean BDF edge.

Parameters:
consumptionRate - The token consumption rate in int[].
Throws:
mocgraph.GraphWeightException - If the length of consumptionRate is not 2.

setBDFProductionRate

public void setBDFProductionRate(int productionRate)
Set the token production rate of a regular BDF edge.

Parameters:
productionRate - The token production rate in int.
Throws:
mocgraph.GraphWeightException - If the productionRate is not positive.

setBDFProductionRate

public void setBDFProductionRate(int[] productionRate)
Set the token production rate of a boolean BDF edge.

Parameters:
productionRate - The token production rate in int[].
Throws:
mocgraph.GraphWeightException - If the length of productionRate is not 2.

setConsumptionRate

public void setConsumptionRate(java.lang.Object consumptionRate)
Override DIFEdgeWeight.setConsumptionRate(Object) to check the type of input object, and call setBDFConsumptionRate(int[]) to set the boolean consumption rate or setBDFConsumptionRate(int) to set the regular consumption rate.

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

setDelay

public void setDelay(int delay)
Set delay of a BDF edge.

Parameters:
delay - The delay in int.

setProductionRate

public void setProductionRate(java.lang.Object productionRate)
Override DIFEdgeWeight.setProductionRate(Object) to check the type of input object, and call setBDFProductionRate(int[]) to set the boolean consumption rate or setBDFProductionRate(int) to set the regular consumption rate.

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

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.