mapss.dif.bdf
Class BDFNodeWeight

java.lang.Object
  extended by mapss.dif.DIFNodeWeight
      extended by mapss.dif.bdf.BDFNodeWeight
All Implemented Interfaces:
java.lang.Cloneable

public class BDFNodeWeight
extends DIFNodeWeight

Information associated with an BDF node. BDFNodeWeights are objects associated with Nodes that represent BDF nodes in Graphs. This class caches frequently-used data associated with BDF nodes.

There are two types of BDF node, one is regular node and the other is boolean node. A regular node is restricted to be an SDF node. A boolean node can be a switch or a select.

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

Constructor Summary
BDFNodeWeight()
          Construct a regular BDF node.
BDFNodeWeight(java.lang.Object computation)
          Construct a regular BDF node weight that is associated with the given computation.
 
Method Summary
 BDFAttributeType getBDFNodeType()
          Get the type of this node.
 ptolemy.math.Fraction getFalseProbability()
          Get the probability of false control tokens.
 ptolemy.math.Fraction getTrueProbability()
          Get the probability of true control tokens.
 void setBDFNodeType(BDFAttributeType type)
          Set the type of this node.
 void setTrueProbability(int numerator, int denominator)
          Set probability of trun control tokens of associated BDFComputation.
 java.lang.String toString()
          Output BDF node weight information.
 
Methods inherited from class mapss.dif.DIFNodeWeight
clone, getComputation, setComputation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BDFNodeWeight

public BDFNodeWeight()
Construct a regular BDF node.


BDFNodeWeight

public BDFNodeWeight(java.lang.Object computation)
Construct a regular BDF node weight that is associated with the given computation.

Method Detail

getBDFNodeType

public BDFAttributeType getBDFNodeType()
Get the type of this node.

Returns:
BDFAttributeType.BooleanNode or BDFAttributeType.RegularNode.

getFalseProbability

public ptolemy.math.Fraction getFalseProbability()
Get the probability of false control tokens.

Returns:
The probability of false control tokens.

getTrueProbability

public ptolemy.math.Fraction getTrueProbability()
Get the probability of true control tokens.

Returns:
The probability of true control tokens.

setBDFNodeType

public void setBDFNodeType(BDFAttributeType type)
Set the type of this node.

Parameters:
type - BDFAttributeType.BooleanNode or BDFAttributeType.RegularNode.

setTrueProbability

public void setTrueProbability(int numerator,
                               int denominator)
Set probability of trun control tokens of associated BDFComputation. The probability is represented in rational, i.e. numerator / denominator.

Parameters:
numerator -
denominator -

toString

public java.lang.String toString()
Output BDF node weight information.

Overrides:
toString in class DIFNodeWeight
Returns:
BDF node weight information.