Package com.bayesserver.causal
Class DisjunctiveCauseInferenceFactory
- java.lang.Object
-
- com.bayesserver.causal.DisjunctiveCauseInferenceFactory
-
- All Implemented Interfaces:
InferenceFactory
public final class DisjunctiveCauseInferenceFactory extends Object implements InferenceFactory
Uses the factory design pattern to create inference related objects for the Disjunctive cause algorithm. SeeInferenceFactoryfor more details.
-
-
Constructor Summary
Constructors Constructor Description DisjunctiveCauseInferenceFactory()Initializes a new instance of theDisjunctiveCauseInferenceFactoryclass.DisjunctiveCauseInferenceFactory(QueryLifecycle queryLifecycle)Initializes a new instance of theDisjunctiveCauseInferenceFactoryclass, with an optional lifecycle instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InferencecreateInferenceEngine(Network network)Creates an instance of an inference algorithm, with the [network] as it's target.QueryOptionscreateQueryOptions()Creates options that govern how eachqueryis performed.QueryOutputcreateQueryOutput()Creates an object that collects information about eachquery, in addition to thedistributions.QueryLifecyclegetQueryLifecycle()Gets a query lifecycle instance.voidsetQueryLifecycle(QueryLifecycle value)Sets a query lifecycle instance.
-
-
-
Constructor Detail
-
DisjunctiveCauseInferenceFactory
public DisjunctiveCauseInferenceFactory()
Initializes a new instance of theDisjunctiveCauseInferenceFactoryclass.
-
DisjunctiveCauseInferenceFactory
public DisjunctiveCauseInferenceFactory(QueryLifecycle queryLifecycle)
Initializes a new instance of theDisjunctiveCauseInferenceFactoryclass, with an optional lifecycle instance.- Parameters:
queryLifecycle- Lifecycle instance to hook up to query events. Can be null.
-
-
Method Detail
-
createInferenceEngine
public Inference createInferenceEngine(Network network)
Creates an instance of an inference algorithm, with the [network] as it's target.- Specified by:
createInferenceEnginein interfaceInferenceFactory- Parameters:
network- The target Bayesian network.- Returns:
- The inference algorithm/engine.
-
getQueryLifecycle
public QueryLifecycle getQueryLifecycle()
Gets a query lifecycle instance. Can be null. This can be used to set the 'Causes of treatments or outcomes' dynamically for each query, e.g. when using the optimizer algorithm.
-
setQueryLifecycle
public void setQueryLifecycle(QueryLifecycle value)
Sets a query lifecycle instance. Can be null. This can be used to set the 'Causes of treatments or outcomes' dynamically for each query, e.g. when using the optimizer algorithm.
-
createQueryOptions
public QueryOptions createQueryOptions()
Creates options that govern how eachqueryis performed. Each algorithm may provide additional options.- Specified by:
createQueryOptionsin interfaceInferenceFactory- Returns:
- The options.
-
createQueryOutput
public QueryOutput createQueryOutput()
Creates an object that collects information about eachquery, in addition to thedistributions. Each algorithm may provide additional output information.The output object can be created once, and reused over many calls to
Inference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).- Specified by:
createQueryOutputin interfaceInferenceFactory- Returns:
- The output instance.
-
-