|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.util.nptgenerator.Function
public abstract class Function
Field Summary | |
---|---|
static java.lang.String |
ALLOWED_CHARACTERS
|
static java.lang.String |
displayName
|
static java.lang.String |
NEWLINE
|
static char |
TAB
|
static double[][] |
VARIANCE_MAP
|
static java.lang.Class[] |
WEIGHTED_FUNCTIONS
|
Constructor Summary | |
---|---|
Function()
|
|
Function(ExtendedNode extendedNode,
java.util.List parents,
java.lang.String[] expressions,
java.lang.String functionType)
|
Method Summary | |
---|---|
static double[] |
calculateFunction(java.lang.String functionType,
java.util.List stateInformation,
java.lang.String[] functionParams,
ExtendedNode extendedFunctionNode)
|
abstract void |
calculateProbability(DataSet values)
Override this method to do what the function requires. |
static Function |
createFunction(java.lang.String functionType,
ExtendedNode node,
java.util.List parents,
java.util.List functionParams)
|
double |
evaluateExpressionAsDouble(DataSet values,
int expressionIndex)
Evaluates the expression at the supplied index. |
java.lang.Object |
evaluateExpressionAsObject(DataSet values,
int expressionIndex)
Evaluates the expression at the supplied index. |
protected void |
generateNPTForNodeWithoutSampling()
This is used to create a single column NPT for a node which is asked to generate an NPT but doesn't have any parents. |
abstract java.lang.String |
getDisplayName()
Shows the name of the Function subclass as it should be displayed in a GUI etc. |
static uk.co.agena.minerva.util.nptgenerator.parserextension.WeightedFunction |
getDummyWeightedFunctionFromTrueName(java.lang.String trueName)
|
double |
getMaximumValueReached()
|
double |
getMinimumValueReached()
|
abstract java.lang.String[] |
getParameterDisplayNames()
Shows the name of the parameters of the Function subclass as they should be displayed in a GUI etc. |
double[] |
getSingleColumnNPT()
|
boolean |
isForceSampling()
|
protected boolean |
requiresSampling()
We can check if this function needs sampling or not by taking each expression and testing to see if it contains the names of any of the parents of this node. |
static void |
resetParserCache()
Resets the cache of parsed expressions. |
void |
setForceSampling(boolean forceSampling)
|
protected void |
setMaximumValueReached(double maximumValueReached)
|
protected void |
setMinimumValueReached(double minimumValueReached)
|
void |
setPossibleMaxOrMinVaule(double value)
Given a value this function will test and assign it to the relative Max or Min Value attained for this function. |
java.lang.String |
toString()
Default toString method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double[][] VARIANCE_MAP
public static final java.lang.String NEWLINE
public static final char TAB
public static java.lang.String displayName
public static final java.lang.String ALLOWED_CHARACTERS
public static final java.lang.Class[] WEIGHTED_FUNCTIONS
Constructor Detail |
---|
public Function()
public Function(ExtendedNode extendedNode, java.util.List parents, java.lang.String[] expressions, java.lang.String functionType) throws NPTGeneratorException, InconsistentEvidenceException
NPTGeneratorException
InconsistentEvidenceException
Method Detail |
---|
public static void resetParserCache()
public abstract java.lang.String getDisplayName()
public abstract java.lang.String[] getParameterDisplayNames()
public abstract void calculateProbability(DataSet values) throws ExtendedBNException, NPTGeneratorInsufficientStateRangeException, NPTGeneratorException
ExtendedBNException
NPTGeneratorInsufficientStateRangeException
NPTGeneratorException
public double evaluateExpressionAsDouble(DataSet values, int expressionIndex) throws NPTGeneratorException
values
- the values used for plugging into the expressionexpressionIndex
- the index of the expression that is to be evaluated
NPTGeneratorException
public java.lang.Object evaluateExpressionAsObject(DataSet values, int expressionIndex) throws NPTGeneratorException
values
- the values used for plugging into the expressionexpressionIndex
- the index of the expression that is to be evaluated
NPTGeneratorException
public boolean isForceSampling()
public void setForceSampling(boolean forceSampling)
protected void generateNPTForNodeWithoutSampling() throws NPTGeneratorException
NPTGeneratorException
public static uk.co.agena.minerva.util.nptgenerator.parserextension.WeightedFunction getDummyWeightedFunctionFromTrueName(java.lang.String trueName) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static Function createFunction(java.lang.String functionType, ExtendedNode node, java.util.List parents, java.util.List functionParams) throws NPTGeneratorException, InconsistentEvidenceException
NPTGeneratorException
InconsistentEvidenceException
public static double[] calculateFunction(java.lang.String functionType, java.util.List stateInformation, java.lang.String[] functionParams, ExtendedNode extendedFunctionNode) throws NPTGeneratorException
NPTGeneratorException
public double[] getSingleColumnNPT()
protected boolean requiresSampling()
public void setPossibleMaxOrMinVaule(double value)
value
- public double getMaximumValueReached()
public double getMinimumValueReached()
protected void setMaximumValueReached(double maximumValueReached)
maximumValueReached
- The maximumValueReached to set.protected void setMinimumValueReached(double minimumValueReached)
minimumValueReached
- The minimumValueReached to set.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |