Class CausalQueryOptionsBase
- java.lang.Object
-
- com.bayesserver.causal.CausalQueryOptionsBase
-
- All Implemented Interfaces:
QueryOptions
- Direct Known Subclasses:
BackdoorQueryOptions
,DisjunctiveCauseQueryOptions
,FrontDoorQueryOptions
public class CausalQueryOptionsBase extends Object implements QueryOptions
Base class for causal query options.
-
-
Constructor Summary
Constructors Constructor Description CausalQueryOptionsBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Cancellation
getCancellation()
Allows cancellation of a query.CausalEffectKind
getCausalEffectKind()
Gets the kind of effect to calculate.InferenceFactory
getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.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)
.DecisionAlgorithm
getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.InconsistentEvidenceMode
getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceException
is raised.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)
.PropagationMethod
getPropagation()
Gets the propagation method to be used during inference.QueryEvidenceMode
getQueryEvidenceMode()
Determines whether evidence is retracted for each query.Integer
getTerminalTime()
Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.protected void
raisePropertyChanged(String name)
void
setCancellation(Cancellation value)
Allows cancellation of a query.void
setCausalEffectKind(CausalEffectKind value)
Sets the kind of effect to calculate.void
setCausalInferenceFactory(InferenceFactory value)
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.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)
.void
setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.void
setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceException
is raised.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)
.void
setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference.void
setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query.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.
-
-
-
Method Detail
-
getCausalInferenceFactory
public InferenceFactory getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
getCausalInferenceFactory
in 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:
setCausalInferenceFactory
in interfaceQueryOptions
-
getCausalEffectKind
public CausalEffectKind getCausalEffectKind()
Gets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
getCausalEffectKind
in 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:
setCausalEffectKind
in interfaceQueryOptions
-
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:
getTerminalTime
in 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:
setTerminalTime
in interfaceQueryOptions
-
getPropagation
public PropagationMethod getPropagation()
Gets the propagation method to be used during inference. Default isPropagationMethod.SUM
.- Specified by:
getPropagation
in interfaceQueryOptions
-
setPropagation
public void setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference. Default isPropagationMethod.SUM
.- Specified by:
setPropagation
in interfaceQueryOptions
-
getDecisionAlgorithm
public DecisionAlgorithm getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.- Specified by:
getDecisionAlgorithm
in interfaceQueryOptions
-
setDecisionAlgorithm
public void setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.- Specified by:
setDecisionAlgorithm
in interfaceQueryOptions
-
getCancellation
public Cancellation getCancellation()
Allows cancellation of a query. When cancelled, aCancellationException
will be raised.If
Cancellation.getCancel()
has been set to true, it should be reset to false, before a subsequent query.- Specified by:
getCancellation
in interfaceQueryOptions
-
setCancellation
public void setCancellation(Cancellation value)
Allows cancellation of a query. When cancelled, aCancellationException
will be raised.If
Cancellation.getCancel()
has been set to true, it should be reset to false, before a subsequent query.- Specified by:
setCancellation
in 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:
getLogLikelihood
in interfaceQueryOptions
- Returns:
true
if 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:
setLogLikelihood
in interfaceQueryOptions
- Parameters:
value
-true
if 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:
getConflict
in 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:
setConflict
in interfaceQueryOptions
-
getQueryEvidenceMode
public QueryEvidenceMode getQueryEvidenceMode()
Determines whether evidence is retracted for each query. SeeQueryEvidenceMode
for more information.- Specified by:
getQueryEvidenceMode
in interfaceQueryOptions
-
setQueryEvidenceMode
public void setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query. SeeQueryEvidenceMode
for more information.- Specified by:
setQueryEvidenceMode
in interfaceQueryOptions
-
getInconsistentEvidenceMode
public InconsistentEvidenceMode getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceException
is raised.- Specified by:
getInconsistentEvidenceMode
in interfaceQueryOptions
-
setInconsistentEvidenceMode
public void setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceException
is raised.- Specified by:
setInconsistentEvidenceMode
in interfaceQueryOptions
-
raisePropertyChanged
protected void raisePropertyChanged(String name)
-
-