blog.distrib
Class Iota

java.lang.Object
  extended by blog.AbstractCondProbDistrib
      extended by blog.DetCondProbDistrib
          extended by blog.distrib.Iota
All Implemented Interfaces:
CondProbDistrib

public class Iota
extends DetCondProbDistrib

CPD that takes a set of size one as an argument, and defines a probability distribution concentrated on the single element of that set. If the argument set is empty, the distribution is concentrated on Model.NULL. If the set has size greater than one, the getProb and sampleVal methods throw IllegalArgumentExceptions.

The name comes from the iota operator in logic.


Constructor Summary
Iota()
          Creates an Iota CPD.
Iota(java.util.List params)
          Creates an Iota CPD.
 
Method Summary
 java.lang.Object getChildValue(java.util.List args)
          Takes a single argument, namely a set S.
 
Methods inherited from class blog.DetCondProbDistrib
getProb, sampleVal
 
Methods inherited from class blog.AbstractCondProbDistrib
getLogProb, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Iota

public Iota()
Creates an Iota CPD.


Iota

public Iota(java.util.List params)
Creates an Iota CPD. The CPD takes no parameters.

Throws:
java.lang.IllegalArgumentException - if params is non-empty
Method Detail

getChildValue

public java.lang.Object getChildValue(java.util.List args)
Takes a single argument, namely a set S. If S is empty, returns Model.NULL. If S has a single element, returns that element. If S has more than one element, throws an IllegalArgumentException.

Specified by:
getChildValue in class DetCondProbDistrib
Throws:
java.lang.IllegalArgumentException - if args contains anything other than a single argument of class Set.