uk.co.agena.minerva.util.nptgenerator
Class Comparative

java.lang.Object
  extended by uk.co.agena.minerva.util.nptgenerator.Function
      extended by uk.co.agena.minerva.util.nptgenerator.Comparative

public class Comparative
extends Function

Comparative allows comparison operations using if-then.


Field Summary
static java.lang.String displayName
           
static java.lang.String[] parameterDisplayNames
           
 
Fields inherited from class uk.co.agena.minerva.util.nptgenerator.Function
ALLOWED_CHARACTERS, NEWLINE, TAB, VARIANCE_MAP, WEIGHTED_FUNCTIONS
 
Constructor Summary
protected Comparative(ExtendedNode extendedNode, java.util.List parents, java.lang.String[] expressions)
           
 
Method Summary
 void calculateProbability(DataSet values)
          This will calculate the SimpleComparative function and add it to the relevant cell of the npt using the rowMajorParentStateCombIndex.
static Comparative Comparative(ExtendedNode extendedNode, java.util.List parents, java.util.List functionParams)
          Will Generate a SimpleComparative NPT using the node and its parent nodes.
static double[] Comparative(java.util.List stateInformation, java.lang.Object value)
           
 java.lang.String getDisplayName()
          Shows the name of the Function subclass as it should be displayed in a GUI etc.
 java.lang.String[] getParameterDisplayNames()
          Shows the name of the parameters of the Function subclass as they should be displayed in a GUI etc.
 java.lang.String toString()
          Default toString method.
 
Methods inherited from class uk.co.agena.minerva.util.nptgenerator.Function
calculateFunction, createFunction, evaluateExpressionAsDouble, evaluateExpressionAsObject, generateNPTForNodeWithoutSampling, getDummyWeightedFunctionFromTrueName, getMaximumValueReached, getMinimumValueReached, getSingleColumnNPT, isForceSampling, requiresSampling, resetParserCache, setForceSampling, setMaximumValueReached, setMinimumValueReached, setPossibleMaxOrMinVaule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

displayName

public static java.lang.String displayName

parameterDisplayNames

public static java.lang.String[] parameterDisplayNames
Constructor Detail

Comparative

protected Comparative(ExtendedNode extendedNode,
                      java.util.List parents,
                      java.lang.String[] expressions)
               throws NPTGeneratorException,
                      InconsistentEvidenceException
Throws:
NPTGeneratorException
InconsistentEvidenceException
Method Detail

Comparative

public static Comparative Comparative(ExtendedNode extendedNode,
                                      java.util.List parents,
                                      java.util.List functionParams)
                               throws NPTGeneratorException,
                                      InconsistentEvidenceException
Will Generate a SimpleComparative NPT using the node and its parent nodes. Will internal set the NPT into the node, depending on the settings.

Parameters:
ebn -
extendedFunctionNode -
expression -
Returns:
Throws:
NPTGeneratorException
InconsistentEvidenceException

calculateProbability

public void calculateProbability(DataSet values)
                          throws ExtendedBNException,
                                 NPTGeneratorInsufficientStateRangeException,
                                 NPTGeneratorException
This will calculate the SimpleComparative function and add it to the relevant cell of the npt using the rowMajorParentStateCombIndex.

Specified by:
calculateProbability in class Function
Parameters:
rowMajorParentStateCombIndex -
values -
Throws:
NPTGeneratorException
ExtendedBNException
NPTGeneratorInsufficientStateRangeException

getDisplayName

public java.lang.String getDisplayName()
Description copied from class: Function
Shows the name of the Function subclass as it should be displayed in a GUI etc.

Specified by:
getDisplayName in class Function

getParameterDisplayNames

public java.lang.String[] getParameterDisplayNames()
Description copied from class: Function
Shows the name of the parameters of the Function subclass as they should be displayed in a GUI etc.

Specified by:
getParameterDisplayNames in class Function

toString

public java.lang.String toString()
Description copied from class: Function
Default toString method. Subclasses should implement their own specific version.

Overrides:
toString in class Function

Comparative

public static double[] Comparative(java.util.List stateInformation,
                                   java.lang.Object value)
Parameters:
stateInformation -
value -
Returns:


Copyright © 2006 Agena Ltd. All Rights Reserved.