Class TreeQueryOptions
- java.lang.Object
-
- com.bayesserver.inference.TreeQueryOptions
-
- All Implemented Interfaces:
QueryOptions
public final class TreeQueryOptions extends Object implements QueryOptions
Options which affect the calculation performed by aTreeQuery.
-
-
Constructor Summary
Constructors Constructor Description TreeQueryOptions()Initializes a new instance of theTreeQueryOptionsclass.TreeQueryOptions(QueryOptions queryOptions)Initializes a new instance of theTreeQueryOptionsclass, copying options from another instance implementingQueryOptions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancellationgetCancellation()Allows cancellation of a query.CausalEffectKindgetCausalEffectKind()Gets the kind of effect to calculate.InferenceFactorygetCausalInferenceFactory()Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.booleangetConflict()Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).DecisionAlgorithmgetDecisionAlgorithm()Gets the algorithm to use when a network contains Decision nodes.InconsistentEvidenceModegetInconsistentEvidenceMode()Determines when anInconsistentEvidenceExceptionis raised.booleangetIsImpliedEvidenceEnabled()Gets a value indicating whether to detect implied evidence during the calculation.booleangetJunctionTree()Gets a value indicating whether or not to generate a junction tree definition.booleangetLogLikelihood()Gets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).PropagationMethodgetPropagation()Gets the propagation method to be used during inference.QueryEvidenceModegetQueryEvidenceMode()Determines whether evidence is retracted for each query.IntegergetTerminalTime()Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.booleangetTreeWidth()Gets a value indicating whether or not to calculate the tree width.voidsetCancellation(Cancellation value)Allows cancellation of a query.voidsetCausalEffectKind(CausalEffectKind value)Sets the kind of effect to calculate.voidsetCausalInferenceFactory(InferenceFactory value)Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.voidsetConflict(boolean value)Sets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).voidsetDecisionAlgorithm(DecisionAlgorithm value)Sets the algorithm to use when a network contains Decision nodes.voidsetInconsistentEvidenceMode(InconsistentEvidenceMode value)Determines when anInconsistentEvidenceExceptionis raised.voidsetIsImpliedEvidenceEnabled(boolean value)Sets a value indicating whether to detect implied evidence during the calculation.voidsetJunctionTree(boolean value)Sets a value indicating whether or not to generate a junction tree definition.voidsetLogLikelihood(boolean value)Sets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).voidsetPropagation(PropagationMethod value)Sets the propagation method to be used during inference.voidsetQueryEvidenceMode(QueryEvidenceMode value)Determines whether evidence is retracted for each query.voidsetTerminalTime(Integer value)Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.voidsetTreeWidth(boolean value)Sets a value indicating whether or not to calculate the tree width.
-
-
-
Constructor Detail
-
TreeQueryOptions
public TreeQueryOptions()
Initializes a new instance of theTreeQueryOptionsclass.
-
TreeQueryOptions
public TreeQueryOptions(QueryOptions queryOptions)
Initializes a new instance of theTreeQueryOptionsclass, copying options from another instance implementingQueryOptions.- Parameters:
queryOptions- The query options to copy.- Throws:
System.ArgumentNullException- queryOptions
-
-
Method Detail
-
getTreeWidth
public boolean getTreeWidth()
Gets a value indicating whether or not to calculate the tree width.
-
setTreeWidth
public void setTreeWidth(boolean value)
Sets a value indicating whether or not to calculate the tree width.
-
getJunctionTree
public boolean getJunctionTree()
Gets a value indicating whether or not to generate a junction tree definition.
-
setJunctionTree
public void setJunctionTree(boolean value)
Sets a value indicating whether or not to generate a junction tree definition.
-
getCausalEffectKind
public CausalEffectKind getCausalEffectKind()
Gets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
getCausalEffectKindin interfaceQueryOptions
-
setCausalEffectKind
public void setCausalEffectKind(CausalEffectKind value)
Sets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
setCausalEffectKindin interfaceQueryOptions
-
getCausalInferenceFactory
public InferenceFactory getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
getCausalInferenceFactoryin interfaceQueryOptions
-
setCausalInferenceFactory
public void setCausalInferenceFactory(InferenceFactory value)
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
setCausalInferenceFactoryin interfaceQueryOptions
-
getIsImpliedEvidenceEnabled
public boolean getIsImpliedEvidenceEnabled()
Gets a value indicating whether to detect implied evidence during the calculation. An example of implied evidence is: Male => Not Pregnant.
-
setIsImpliedEvidenceEnabled
public void setIsImpliedEvidenceEnabled(boolean value)
Sets a value indicating whether to detect implied evidence during the calculation. An example of implied evidence is: Male => Not Pregnant.
-
getTerminalTime
public Integer getTerminalTime()
Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.- Specified by:
getTerminalTimein interfaceQueryOptions
-
setTerminalTime
public void setTerminalTime(Integer value)
Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.- Specified by:
setTerminalTimein interfaceQueryOptions
-
getPropagation
public PropagationMethod getPropagation()
Gets the propagation method to be used during inference. Default isPropagationMethod.SUM.- Specified by:
getPropagationin interfaceQueryOptions
-
setPropagation
public void setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference. Default isPropagationMethod.SUM.- Specified by:
setPropagationin interfaceQueryOptions
-
getDecisionAlgorithm
public DecisionAlgorithm getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.- Specified by:
getDecisionAlgorithmin interfaceQueryOptions
-
setDecisionAlgorithm
public void setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.- Specified by:
setDecisionAlgorithmin interfaceQueryOptions
-
getCancellation
public Cancellation getCancellation()
Allows cancellation of a query. When cancelled, aCancellationExceptionwill be raised.If
Cancellation.getCancel()has been set to true, it should be reset to false, before a subsequent query.- Specified by:
getCancellationin interfaceQueryOptions
-
setCancellation
public void setCancellation(Cancellation value)
Allows cancellation of a query. When cancelled, aCancellationExceptionwill be raised.If
Cancellation.getCancel()has been set to true, it should be reset to false, before a subsequent query.- Specified by:
setCancellationin interfaceQueryOptions
-
getLogLikelihood
public boolean getLogLikelihood()
Gets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getLogLikelihood().This should only be requested if required.
The natural log (base e) is calculated.
- Specified by:
getLogLikelihoodin interfaceQueryOptions- Returns:
trueif the log-likelihood should be calculated; otherwise,false. Defaults to false.
-
setLogLikelihood
public void setLogLikelihood(boolean value)
Sets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getLogLikelihood().This should only be requested if required.
The natural log (base e) is calculated.
- Specified by:
setLogLikelihoodin interfaceQueryOptions- Parameters:
value-trueif the log-likelihood should be calculated; otherwise,false. Defaults to false.
-
getConflict
public boolean getConflict()
Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getConflict().Conflict is a measure that detects evidence that is conflicting or rare. The greater the conflict value above zero, the more likely the evidence is in conflict, or rare.
Conflict = log((P(e1)P(e2)...P(ei)) / P(e)), where P(e1), P(e2) etc... are the likelihoods of each variable considered in isolation, and P(e) is the likelihood of the all the evidence together.
- Specified by:
getConflictin interfaceQueryOptions
-
setConflict
public void setConflict(boolean value)
Sets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput). If calculated the result can be obtained fromQueryOutput.getConflict().Conflict is a measure that detects evidence that is conflicting or rare. The greater the conflict value above zero, the more likely the evidence is in conflict, or rare.
Conflict = log((P(e1)P(e2)...P(ei)) / P(e)), where P(e1), P(e2) etc... are the likelihoods of each variable considered in isolation, and P(e) is the likelihood of the all the evidence together.
- Specified by:
setConflictin interfaceQueryOptions
-
getQueryEvidenceMode
public QueryEvidenceMode getQueryEvidenceMode()
Determines whether evidence is retracted for each query. SeeQueryEvidenceModefor more information.- Specified by:
getQueryEvidenceModein interfaceQueryOptions
-
setQueryEvidenceMode
public void setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query. SeeQueryEvidenceModefor more information.- Specified by:
setQueryEvidenceModein interfaceQueryOptions
-
getInconsistentEvidenceMode
public InconsistentEvidenceMode getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceExceptionis raised.- Specified by:
getInconsistentEvidenceModein interfaceQueryOptions
-
setInconsistentEvidenceMode
public void setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceExceptionis raised.- Specified by:
setInconsistentEvidenceModein interfaceQueryOptions
-
-