uk.co.agena.minerva.model.extendedbn
Class RankedEN

java.lang.Object
  extended by uk.co.agena.minerva.model.extendedbn.ExtendedNode
      extended by uk.co.agena.minerva.model.extendedbn.NumericalEN
          extended by uk.co.agena.minerva.model.extendedbn.ContinuousEN
              extended by uk.co.agena.minerva.model.extendedbn.ContinuousIntervalEN
                  extended by uk.co.agena.minerva.model.extendedbn.RankedEN
All Implemented Interfaces:
java.lang.Comparable, java.util.EventListener, ExtendedNodeListener, ExtendedStateListener, Identifiable, Nameable, Writable

public class RankedEN
extends ContinuousIntervalEN

This class is used to represent nodes whose states are in a ranked order e.g. {Bad, Medium, Good} where each state corresponds to an interval.


Field Summary
protected static java.lang.String[][] defaultStateNames
           
protected static java.lang.String[] supportedFunctionTypes
           
 
Fields inherited from class uk.co.agena.minerva.model.extendedbn.ContinuousEN
continueToDynamicallyDiscretise, ddRelativeSumWidthEntropyErrors, dynamicallyDiscretisable, entropyConvergenceThreshold, uniformJustSet
 
Fields inherited from class uk.co.agena.minerva.model.extendedbn.ExtendedNode
actOnMarginalsChangedEvent, answerable, connBn, connectableInputNode, connectableOutputNode, connNodeId, CONTINUOUS_INTERVAL_E_N, CURRENT_FUNCTION_STRING, currentNodeFunction, currentParentModelNodeAltId, currentPartitionedModelNodeFunctions, currentPartitionedParentModelNodeAltIds, currentPartitionedParentModelNodes, DEFAULT_FUNCTION_STRING, defaultNodeFunction, defaultParentModelNodeAltId, defaultPartitionedModelNodeFunctions, defaultPartitionedParentModelNodeAltIds, defaultPartitionedParentModelNodes, DELTA, DISCRETE_REAL_E_N, EDITABLE_NODE_FUNCTION, EDITABLE_NPT, EDITABLE_PARENT_STATE_FUNCTIONS, extendedStates, functionMode, id, inputNodeReceivedMarginals, LABELLED_E_N, name, nptReCalcRequired, nptSynchronisedWithFormula, NUMERICAL_E_N, PROBS_NOT_EDITABLE, reportable, targetValue, targetValuePresent, version, visible
 
Fields inherited from interface uk.co.agena.minerva.util.model.Writable
FIELD_SEPARATOR
 
Constructor Summary
RankedEN()
          Creates a default RankedEN.
RankedEN(NameDescription name, uk.co.agena.minerva.model.corebn.CoreBN connBn)
           
RankedEN(NameDescription name, java.lang.String connNodeId, uk.co.agena.minerva.model.corebn.CoreBN connBn)
           
 
Method Summary
 void configureDefaultExtendedStates()
          Sets up a default list of ExtendedStates for this node based on the default state names for this class.
 java.util.List createExtendedStates(DataSet ds)
          Takes the supplied DataSet and uses it to generate a List of ExtendedStates which are then returned.
static java.lang.String[][] getDefaultStateNames()
           
static int getRankedSampleSize()
           
 java.lang.Object getSamplesForState(int index, boolean boundsOnly)
          Returns a set of values that are sampled from the state at the supplied index.
 java.lang.String[] getSupportedFunctionTypes()
          Returns a list of the function classes supported by this node type.
 ExtendedState insertExtendedState(int index, Range r)
          Inserts a state with the supplied range at the specified index.
 boolean isDynamicallyDiscretisable()
           
 ExtendedState mergeExtendedStates(int startIndex, int endIndex)
           
static void setRankedSampleSize(int rankedSampleSize)
           
 
Methods inherited from class uk.co.agena.minerva.model.extendedbn.ContinuousIntervalEN
extendedNodeAttributeChanged, fillArraysUsingAbsolutes
 
Methods inherited from class uk.co.agena.minerva.model.extendedbn.ContinuousEN
addDDRelativeSumWidthEntropyError, addRangeNotToBeSplit, areNeighboringStatesDisceteValues, cloneTypeSpecific, constructExtraFieldString, copy, createDataPointFromExtendedState, createDataSetForExtendedStates, createDataSetFromNumericValue, createEmptyDataSet, createLogStates, createLogStates, createNewExtendedState, createNewExtendedState, extendedStateRangesForValue, getClosestMedianStateIndex, getDdRelativeSumWidthEntropyErrors, getDisceteValues, getDisceteValuesStateIndexes, getEntropyConvergenceThreshold, getFirstBound, getIndexOfStateThatContains, getLastBound, getRangesNotToBeSplit, getSamplesForState, getSampleSize, getScaledTargetValue, getTargetValueAsString, getTargetValueRange, insertExtendedState, insertStatesForValues, isContinueToDynamicallyDiscretise, isSimulationNode, isStateSplitable, isUniformJustSet, mergeExtendedStates, performSplit, processExtraFields, replaceState, replaceState, resetRangesNotToBeSplitList, setContinueToDynamicallyDiscretise, setDdRelativeSumWidthEntropyErrors, setDynamicallyDiscretisable, setEntropyConvergenceThreshold, setNameOfIntervalDataPoint, setNameOfStateUsingRange, setSampleSize, setSimulationNode, setTargetValueFromString, setUniform, setUniformJustSet, truncateStates
 
Methods inherited from class uk.co.agena.minerva.model.extendedbn.NumericalEN
fillArraysUsingIntervals, mean, median, percentile, standardDeviation, variance
 
Methods inherited from class uk.co.agena.minerva.model.extendedbn.ExtendedNode
addChild, addExpressionVariable, addExtendedNodeListener, addExtendedState, addExtendedState, addExtendedStates, addParent, compareTo, containsFunctionOfType, containsOnlyStatisticalFunctions, cropFunctions, enterDistributionOfEvidence, enterDistributionOfEvidence, enterHardEvidence, enterHardEvidence, extendedNodeConnBNNotFound, extendedNodeConnNodeIdChanged, extendedNodeInconsistentEvidenceEntered, extendedNodeMarginalsChanged, extendedNodeNameDescriptionChanged, extendedNodeStateNameChanged, extendedNodeStatesReplaced, extendedNodeVariableAdded, extendedNodeVariableRemoved, extendedNodeVisibleAttributeChanged, extendedStateAdded, extendedStateNameDescriptionChanged, extendedStateRemoved, fireMarginalsChangedEvent, getActOnMarginalsChangedEvent, getAnswerable, getConcreteNodeName, getConcreteNodeType, getConcreteNodeTypeNames, getConnBn, getConnNodeId, getCoreBNNodeEquivalents, getCurrentNodeFunction, getCurrentParentModelNodeAltId, getCurrentPartitionedModelNodeFunctions, getCurrentPartitionedParentModelNodeAltIds, getCurrentPartitionedParentModelNodes, getDefaultNodeFunction, getDefaultParentModelNodeAltId, getDefaultPartitionedModelNodeFunctions, getDefaultPartitionedParentModelNodeAltIds, getDefaultPartitionedParentModelNodes, getExpression, getExpressionVariables, getExtendedState, getExtendedStateAtIndex, getExtendedStates, getExtendedStateShortNames, getExtendedStateWithName, getExtendedStateWithShortDesc, getFunctionMode, getHardEvidence, getId, getInputNodeRecivedMarginalsAsEvidenceDS, getLastSavedPriorIndex, getMarginals, getName, getNextExtendedStateId, getNodeType, getNotes, getNPT, getNPTPopulationMethodAsString, getNPTSize, getNumberOfStateCombsForModelNodes, getPartitionedExpressionModelNodes, getPartitionedExpressions, getReportable, getRowMajorNPT, getSavedPriors, getSuitableMessagePassingNodes, getTargetValue, getTargetValueRangeAsString, getTotalNumberOfExtendedFunctions, getVersion, getVisible, hasParents, isChangeStatesOnInputNodeIfRequired, isConnectableInputNode, isConnectableOutputNode, isInputNodeReceivedMarginals, isInputNodeRecivedMarginalsAsEvidence, isNptReCalcRequired, isNptSynchronisedWithFormula, isTargetValuePresent, isTemporaryNodeOrderFlag, mode, nodeChanged, read, recalculateConnStateIndices, removeAllFurtherSavedPriors, removeExpressionVariable, removeExtendedNodeListener, removeExtendedState, replicateNodeStates, revert2savedPrior, savePrior, setActOnMarginalsChangedEvent, setAnswerable, setChangeStatesOnInputNodeIfRequired, setConnBn, setConnectableInputNode, setConnectableOutputNode, setConnNodeId, setCurrentNodeFunction, setCurrentParentModelNodeAltId, setCurrentPartitionedModelNodeFunctions, setCurrentPartitionedParentModelNodeAltIds, setCurrentPartitionedParentModelNodes, setDefaultNodeFunction, setDefaultParentModelNodeAltId, setDefaultPartitionedModelNodeFunctions, setDefaultPartitionedParentModelNodeAltIds, setDefaultPartitionedParentModelNodes, setExpression, setExpressionVariables, setExtendedStates, setExtendedStates, setFunctionMode, setId, setInputNodeReceivedMarginals, setInputNodeRecivedMarginalsAsEvidence, setInputNodeRecivedMarginalsAsEvidenceDS, setName, setNotes, setNPT, setNPT, setNPT, setNPTForSingleModelParentNode, setNptReCalcRequired, setNptSynchronisedWithFormula, setPartitionedExpressionModelNodes, setPartitionedExpressions, setReportable, setSavedPriors, setTargetValue, setTargetValuePresent, setTemporaryNodeOrderFlag, setupActionForMarginalsChangedEvent, setVersion, setVisible, storeFunctionsCorrectly, toString, updateConnNodeId, updateExpressionVariable, updateFunctionsParentConnNodeId, updateFunctionType, usedInCurrentExpression, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

supportedFunctionTypes

protected static java.lang.String[] supportedFunctionTypes

defaultStateNames

protected static java.lang.String[][] defaultStateNames
Constructor Detail

RankedEN

public RankedEN()
Creates a default RankedEN.


RankedEN

public RankedEN(NameDescription name,
                java.lang.String connNodeId,
                uk.co.agena.minerva.model.corebn.CoreBN connBn)
         throws ExtendedBNException
Parameters:
name -
connNodeId -
connBn -
Throws:
ExtendedBNException

RankedEN

public RankedEN(NameDescription name,
                uk.co.agena.minerva.model.corebn.CoreBN connBn)
         throws ExtendedBNException
Parameters:
name -
connBn -
Throws:
ExtendedBNException
Method Detail

getDefaultStateNames

public static java.lang.String[][] getDefaultStateNames()

getRankedSampleSize

public static int getRankedSampleSize()
Returns:
Returns the rankedSampleSize.

setRankedSampleSize

public static void setRankedSampleSize(int rankedSampleSize)
Parameters:
rankedSampleSize - The rankedSampleSize to set.

configureDefaultExtendedStates

public void configureDefaultExtendedStates()
                                    throws ExtendedStateException
Sets up a default list of ExtendedStates for this node based on the default state names for this class.

Overrides:
configureDefaultExtendedStates in class ContinuousIntervalEN
Throws:
ExtendedStateException

getSamplesForState

public java.lang.Object getSamplesForState(int index,
                                           boolean boundsOnly)
                                    throws ExtendedStateException
Description copied from class: ExtendedNode
Returns a set of values that are sampled from the state at the supplied index. Different subtypes use different sampling algorithms and will return different types (e.g. doubles, Strings).

Overrides:
getSamplesForState in class ContinuousEN
Parameters:
index - the index of the state that is to be sampled
boundsOnly - TODO
Returns:
an Object encapsulating an array of samples
Throws:
ExtendedStateException

createExtendedStates

public java.util.List createExtendedStates(DataSet ds)
                                    throws ExtendedStateNumberingException,
                                           ExtendedStateException
Description copied from class: ExtendedNode
Takes the supplied DataSet and uses it to generate a List of ExtendedStates which are then returned. Each type of node can potentially use the DataSet to generate states in a different. Implementations are provided lower down in the hierarchy.

Overrides:
createExtendedStates in class ContinuousIntervalEN
Parameters:
ds - the DataSet used for creating the ExtendedStates
Returns:
a List of created ExtendedStates
Throws:
ExtendedStateNumberingException
ExtendedStateException

mergeExtendedStates

public ExtendedState mergeExtendedStates(int startIndex,
                                         int endIndex)
                                  throws ExtendedNodeMethodNotSupportedException,
                                         ExtendedBNException
Overrides:
mergeExtendedStates in class ContinuousEN
Throws:
ExtendedNodeMethodNotSupportedException
ExtendedBNException

insertExtendedState

public ExtendedState insertExtendedState(int index,
                                         Range r)
                                  throws ExtendedNodeMethodNotSupportedException,
                                         ExtendedBNException
Description copied from class: ContinuousEN
Inserts a state with the supplied range at the specified index.

Overrides:
insertExtendedState in class ContinuousEN
Parameters:
index - where to add the state
r - the range that the state will have
Returns:
the inserted state
Throws:
ExtendedNodeMethodNotSupportedException
ExtendedBNException

getSupportedFunctionTypes

public java.lang.String[] getSupportedFunctionTypes()
Returns a list of the function classes supported by this node type.

Overrides:
getSupportedFunctionTypes in class ContinuousEN
Returns:

isDynamicallyDiscretisable

public boolean isDynamicallyDiscretisable()
Overrides:
isDynamicallyDiscretisable in class ContinuousEN
Returns:
Always returns false.


Copyright © 2006 Agena Ltd. All Rights Reserved.