public class SwitchingAlgorithm extends java.lang.Object implements InferenceAlgorithm
The switching mechanism is defined via two thresholds:
If one of these threshold is exceeded or if the Bayesian network contains a continuous distribution, the selected algorithm will be likelihood weighting. Variable elimination is selected in the remaining cases.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BRANCHING_FACTOR |
static int |
MAX_NBVALUES |
Constructor and Description |
---|
SwitchingAlgorithm() |
Modifier and Type | Method and Description |
---|---|
MultivariateDistribution |
queryProb(Query.ProbQuery query)
Selects the best algorithm for performing the inference on the provided
probability query and return its result.
|
UtilityTable |
queryUtil(Query.UtilQuery query)
Selects the best algorithm for performing the inference on the provided
utility query and return its result.
|
BNetwork |
reduce(Query.ReduceQuery query)
Reduces a Bayesian network to a subset of variables.
|
InferenceAlgorithm |
selectBestAlgorithm(Query query) |
public static int MAX_BRANCHING_FACTOR
public static int MAX_NBVALUES
public MultivariateDistribution queryProb(Query.ProbQuery query)
queryProb
in interface InferenceAlgorithm
query
- the probability querypublic UtilityTable queryUtil(Query.UtilQuery query)
queryUtil
in interface InferenceAlgorithm
query
- the utility querypublic BNetwork reduce(Query.ReduceQuery query)
reduce
in interface InferenceAlgorithm
query
- the reduction querypublic InferenceAlgorithm selectBestAlgorithm(Query query)