edu.ucla.belief
Class NoisyOrShellPearl
Object
NoisyOrShellPearl
- All Implemented Interfaces:
- CPTShell, NoisyOrShell, Potential, Cloneable
public class NoisyOrShellPearl
- extends Object
- implements NoisyOrShell
- Since:
- 060803
- Author:
- Hei Chan
Method Summary |
Object |
clone()
|
double[] |
computeNoisyOr(int x,
int lp,
int size,
int[] blocks,
int[][] strengths)
|
void |
ensureNonsingular()
|
void |
expand(FiniteVariable var)
|
double[] |
expandNoisyOr()
Expand noisy-Or weights into CPT. |
void |
forget(Variable from)
|
double |
getCP(int index)
|
double |
getCP(int[] indices)
|
double |
getCP(Map instantiations)
|
double |
getCP(Object[] instantiations)
|
double |
getCP(Object[] parentInstantiations,
Object childInstatiation)
|
double |
getCPD(int rIndex,
int[] mindex)
|
double |
getCPScaled(int ind)
|
double |
getCPScaled(int[] indices)
|
Table |
getCPT()
|
CPTParameter |
getCPTParameter(int index)
|
CPTParameter |
getCPTParameter(int[] mindex)
|
CPTParameter[] |
getCPTParameters()
|
int[][] |
getIndexes()
|
double[] |
getLeaks()
|
double[][][] |
getParams()
|
Set |
getRelevant(int[] indices)
|
Set |
getRelevant(Map instantiations)
|
Set |
getRelevant(Object[] instantiations)
|
Set |
getRelevant(Object[] parentInstantiations,
Object childInstatiation)
|
FiniteVariable |
getVariable()
|
CPTParameter |
getWeightParameter(int weightIndex)
|
CPTParameter[] |
getWeightParameters()
|
TableIndex |
index()
|
void |
insertState(int index)
|
void |
multiplyInto(Table t2)
|
void |
normalize()
|
void |
parentStateInserted(FiniteVariable parent,
int indexNewInstance)
|
void |
parentStateRemoved(FiniteVariable parent,
int indexRemovedInstance)
|
int |
randomJointValueIndex(Map mapInstantions)
|
void |
removeState(int index)
|
void |
replaceVariables(Map old2new,
boolean partial)
|
void |
resetParamsAndLeaks()
|
double |
scalar()
|
void |
setWeights(double[] weights)
|
void |
setWeights(List listWeights)
|
int[][] |
strengths()
|
int[] |
strengthsClone()
|
List |
variables()
|
List |
weightsAsList()
|
double[] |
weightsClone()
|
STR_ERROR_WEIGHTS_LEN
public static final String STR_ERROR_WEIGHTS_LEN
- See Also:
- Constant Field Values
NoisyOrShellPearl
public NoisyOrShellPearl(List parents,
FiniteVariable child,
double[] weights,
int[] strengths)
throws Exception
- Throws:
Exception
clone
public Object clone()
- Specified by:
clone
in interface Potential
- Overrides:
clone
in class Object
randomJointValueIndex
public int randomJointValueIndex(Map mapInstantions)
- Specified by:
randomJointValueIndex
in interface CPTShell
- Since:
- 021704
getVariable
public FiniteVariable getVariable()
- Specified by:
getVariable
in interface CPTShell
variables
public List variables()
- Specified by:
variables
in interface CPTShell
- Specified by:
variables
in interface Potential
getIndexes
public int[][] getIndexes()
- Since:
- 050903
getParams
public double[][][] getParams()
getLeaks
public double[] getLeaks()
getCPTParameters
public CPTParameter[] getCPTParameters()
- Specified by:
getCPTParameters
in interface CPTShell
getCPTParameter
public CPTParameter getCPTParameter(int index)
- Specified by:
getCPTParameter
in interface CPTShell
getCPTParameter
public CPTParameter getCPTParameter(int[] mindex)
- Specified by:
getCPTParameter
in interface CPTShell
getWeightParameters
public CPTParameter[] getWeightParameters()
- Specified by:
getWeightParameters
in interface NoisyOrShell
getWeightParameter
public CPTParameter getWeightParameter(int weightIndex)
- Specified by:
getWeightParameter
in interface NoisyOrShell
resetParamsAndLeaks
public void resetParamsAndLeaks()
throws Exception
- Throws:
Exception
setWeights
public void setWeights(List listWeights)
throws Exception
- Specified by:
setWeights
in interface NoisyOrShell
- Throws:
Exception
- Since:
- 041403
setWeights
public void setWeights(double[] weights)
throws Exception
- Specified by:
setWeights
in interface NoisyOrShell
- Throws:
Exception
- Since:
- 061103
weightsClone
public double[] weightsClone()
- Specified by:
weightsClone
in interface NoisyOrShell
- Since:
- 041403
strengthsClone
public int[] strengthsClone()
weightsAsList
public List weightsAsList()
- Specified by:
weightsAsList
in interface NoisyOrShell
- Since:
- 041403
ensureNonsingular
public void ensureNonsingular()
- Specified by:
ensureNonsingular
in interface CPTShell
normalize
public void normalize()
throws Exception
- Specified by:
normalize
in interface CPTShell
- Throws:
Exception
replaceVariables
public void replaceVariables(Map old2new,
boolean partial)
- Specified by:
replaceVariables
in interface CPTShell
partial
- If true, then skip warnings about incomplete mapping.- Since:
- 20080220
multiplyInto
public void multiplyInto(Table t2)
- Specified by:
multiplyInto
in interface CPTShell
forget
public void forget(Variable from)
- Specified by:
forget
in interface CPTShell
expand
public void expand(FiniteVariable var)
- Specified by:
expand
in interface CPTShell
insertState
public void insertState(int index)
- Specified by:
insertState
in interface CPTShell
removeState
public void removeState(int index)
- Specified by:
removeState
in interface CPTShell
parentStateInserted
public void parentStateInserted(FiniteVariable parent,
int indexNewInstance)
- Specified by:
parentStateInserted
in interface CPTShell
parentStateRemoved
public void parentStateRemoved(FiniteVariable parent,
int indexRemovedInstance)
- Specified by:
parentStateRemoved
in interface CPTShell
index
public TableIndex index()
- Specified by:
index
in interface CPTShell
getCPT
public Table getCPT()
- Specified by:
getCPT
in interface CPTShell
scalar
public double scalar()
- Specified by:
scalar
in interface CPTShell
- Since:
- 041403
getCPScaled
public double getCPScaled(int ind)
- Specified by:
getCPScaled
in interface CPTShell
getCPScaled
public double getCPScaled(int[] indices)
- Specified by:
getCPScaled
in interface CPTShell
getCP
public double getCP(int index)
- Specified by:
getCP
in interface CPTShell
getCP
public double getCP(int[] indices)
- Specified by:
getCP
in interface CPTShell
- Since:
- 050703
getCPD
public double getCPD(int rIndex,
int[] mindex)
getCP
public double getCP(Object[] instantiations)
- Specified by:
getCP
in interface CPTShell
getCP
public double getCP(Map instantiations)
- Specified by:
getCP
in interface CPTShell
getCP
public double getCP(Object[] parentInstantiations,
Object childInstatiation)
- Specified by:
getCP
in interface CPTShell
getRelevant
public Set getRelevant(int[] indices)
- Specified by:
getRelevant
in interface CPTShell
getRelevant
public Set getRelevant(Object[] instantiations)
- Specified by:
getRelevant
in interface CPTShell
getRelevant
public Set getRelevant(Map instantiations)
- Specified by:
getRelevant
in interface CPTShell
getRelevant
public Set getRelevant(Object[] parentInstantiations,
Object childInstatiation)
- Specified by:
getRelevant
in interface CPTShell
strengths
public int[][] strengths()
expandNoisyOr
public double[] expandNoisyOr()
Expand noisy-Or weights into CPT.
- Specified by:
expandNoisyOr
in interface NoisyOrShell
- Since:
- 050703
computeNoisyOr
public double[] computeNoisyOr(int x,
int lp,
int size,
int[] blocks,
int[][] strengths)
Copyright 2010 UCLA Automated Reasoning Group