com.cra.figaro.algorithm.structured.algorithm.flat
Verify that all constraint factors satisfy the bounds needed for the correctness of this algorithm.
Verify that all constraint factors satisfy the bounds needed for the correctness of this algorithm. This gets executed before solving. By default, this method does nothing; subclasses can override this to throw an exception if the bounds requirements are not met.
Called when the algorithm is killed.
Called when the algorithm is killed. By default, does nothing. Can be overridden.
Collection of problem components for this inference problem.
Collection of problem components for this inference problem. Defaults to a new, empty, collection for non-recursive models.
Computes the normalized distribution over a single target element.
Computes the normalized distribution over a single target element. Throws an IllegalArgumentException if the range of the target contains star, or if lower and upper bounds are needed.
Computes the expectation of a given function for single target element.
Computes the expectation of a given function for single target element. Throws an IllegalArgumentException if the range of the target contains star, or if lower and upper bounds are needed.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the marginal probability distribution over the target that lists each element with its probability.
Return an estimate of the marginal probability distribution over the target that lists each element with its probability. The result is a lazy stream. It is up to the algorithm how the stream is ordered. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the expectation of the function under the marginal probability distribution of the target. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Return an estimate of the expectation of the function under the marginal probability distribution of the target.
Return an estimate of the expectation of the function under the marginal probability distribution of the target. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Initial elements to pass to the bottom-up strategy for decomposition.
Initial elements to pass to the bottom-up strategy for decomposition. Defaults to a list containing all problem targets and all evidence elements in the universe.
Initialize the problem by adding all permanent elements to it.
Initialize the problem by adding all permanent elements to it. This is to ensure that all top-level elements are correctly added to the top-level problem.
Kill the algorithm so that it is inactive.
Kill the algorithm so that it is inactive. It will no longer be able to provide answers.Throws AlgorithmInactiveException if the algorithm is not active.
Return the mean of the probability density function for the given continuous element.
Return the mean of the probability density function for the given continuous element.
All bounds for which this algorithm needs to compute solutions.
All bounds for which this algorithm needs to compute solutions. This is determined by looking for components that have * in their range, and have constraint factors associated with them. If such a component exists, we need both lower and upper bounds. Otherwise, just one of the bounds suffices because they are equivalent; it defaults to lower in this case.
All bounds for which this algorithm should compute solutions.
Return an element representing the posterior probability distribution of the given element.
Return an element representing the posterior probability distribution of the given element.
Return an estimate of the probability that the target produces the value.
Return an estimate of the probability that the target produces the value. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target.
Return an estimate of the probability of the predicate under the marginal probability distribution of the target. Throws NotATargetException if called on a target that is not in the list of targets of the algorithm. Throws AlgorithmInactiveException if the algorithm is inactive.
Inference problem to be solved.
Inference problem to be solved.
List of targets that should not be eliminated when solving the problem.
List of targets that should not be eliminated when solving the problem.
Targets for the problem.
Extract the solution in a way that allows fast queries to the algorithm.
Extract the solution in a way that allows fast queries to the algorithm. This usually involves storing some form of the solution in a variable, but the exact implementation is up to the algorithm that overrides this.
A map from bounds to computed solutions for those bounds. Contains one key for each of the bounds
needed, according to neededBounds()
.
Uses the default ranging strategy with ParticleGenerator.defaultNumSamplesFromAtomics
values.
Uses the default ranging strategy with ParticleGenerator.defaultNumSamplesFromAtomics
values.
Strategy to use for refinement at a single iteration.
Strategy to use for refinement at a single iteration. This may return a new strategy for each iteration.
A refining strategy to be used for a single iteration.
Resume the computation of the algorithm, if it has been stopped.
Resume the computation of the algorithm, if it has been stopped. Throws AlgorithmInactiveException if the algorithm is not active.
Run the algorithm, performing its computation to completion.
Run the algorithm, performing its computation to completion.
Run a single iteration of refinement/solving, then record the solutions.
Run a single iteration of refinement/solving, then record the solutions.
Strategy to use for solving at a single iteration.
Strategy to use for solving at a single iteration. This may return a new strategy for each iteration.
A solving strategy to be used for a single iteration.
Start the algorithm and make it active.
Start the algorithm and make it active. After it returns, the algorithm must be ready to provide answers. Throws AlgorithmActiveException if the algorithm is already active.
Stop the algorithm from computing.
Stop the algorithm from computing. The algorithm is still ready to provide answers after it returns. Throws AlgorithmInactiveException if the algorithm is not active.
Universe to which elements in the corresponding problem belong.
Universe to which elements in the corresponding problem belong.
Return the variance of the probability density function for the given continuous element.
Return the variance of the probability density function for the given continuous element.