Algorithms can be instructed to use an abstraction scheme to reason about an element (see AbstractionScheme.scala).
In an abstraction, the values of an element are reduced to a smaller, abstract set of values.
In an abstraction, the values of an element are reduced to a smaller, abstract set of values. Each concrete value is mapped to a specific abstract value. Algorithms might choose to operate on the abstract values rather than the concrete values.
Elements that undergo an abstraction use an abstraction scheme to govern it. The abstraction scheme consists of two methods. The first, select, determines the representative points for the abstraction to which all points are mapped. The second, map, maps a point to one of the representative points.
The map method is actually included in the PointMapper trait that AbstractionScheme extends. All elements have a PointMapper, not just those that undergo an abstraction. This can be used in the implementation of algorithms (see, e.g., Factor.scala). The implicit PointMapper is one that maps every point to itself, so it can safely be used for every element that does not undergo an abstraction.
Probably the most common type of abstraction is discretization of continuous elements. Currently the RegularDiscretization scheme is implemented, which uses evenly space abstract point. There is an implicit abstraction scheme for Double elements using RegularDiscretization so one does not have to be specified explicitly.
The general class of Figaro algorithms.
The general class of Figaro algorithms. The Algorithm class is defined to generalize both one-time and anytime algorithms, using a start/stop/resume/kill mechanism.
An anytime algorithm is able to improve its estimated answers over time.
An anytime algorithm is able to improve its estimated answers over time. Anytime algorithms run in their own thread using an actor.
An anytime algorithm must implement initialize, runStep, and handle methods. runStep will typically send a Handle message to the actor containing a Service, and the algorithm will provide a handle method to implement this Service. The handle method will return a Response, which is sent back to runStep.
Anytime algorithms that compute most likely values of elements.
Anytime algorithms that compute most likely values of elements. A class that implements this trait must implement initialize, runStep, computeDistribution, and computeExpectation methods.
Anytime algorithms that compute probability of evidence.
Anytime algorithms that compute probability of evidence. A class that implements this trait must implement initialize, runStep, and computeProbEvidence methods.
Anytime algorithms that compute conditional probability of query elements.
Anytime algorithms that compute conditional probability of query elements. A class that implements this trait must implement initialize, runStep, computeDistribution, and computeExpectation methods.
Algorithms that compute conditional probabilities of queries.
Algorithms that compute conditional probabilities of queries. This is a base trait, to provide support for both elements in a single universe, or references across multiple universes. Generic type U is either an Element or a Reference. T is the type of the element or reference.
Exception Response (String)
A message to the handler to handle the given service.
A lazy algorithm is an algorithm that can be run to increasing depths.
Algorithms that compute the most likely values of elements.
Messages to or from the actor.
A one-time algorithm runs in a single step to produce its answers.
A one-time algorithm runs in a single step to produce its answers. It cannot be run again to improve the answers. Implementations of OneTime must implement the run method.
One-time algorithms that compute the most likely values of elements.
One-time algorithms that compute the most likely values of elements. A class that implements this trait must implement run and mostLikelyValue methods.
One-time algorithms that compute probability of evidence.
One-time algorithms that compute probability of evidence. A class that implements this trait must implement the run and computeprobEvidence methods.
One-time algorithms that compute conditional probability of query elements.
One-time algorithms that compute conditional probability of query elements. A class that implements this trait must implement run, computeDistribution, and computeExpectation methods.
Trait of algorithms that learn parameters.
Trait of functions that map concrete points to abstract points.
A predicate defined on an element.
Algorithms that compute probability of evidence.
Algorithms that compute probability of evidence. The evidence is specified as a list of named Evidence items. In addition to the universe, the ProbEvidenceAlgorithm takes two optional arguments. The evidence, which defaults to empty, and the denominator, which defaults to 1. The evidence is a list of specific evidence items associated with references. When started, the algorithm computes the probability of the named evidence, in addition to the conditions and constraints in the model, divided by the denominator (partition function). In a typical use case, one might want to compute the probability of the named evidence, taking the conditions and constraints as a given part of the model. To achieve this, you would create a ProbEvidenceAlgorithm with no evidence to compute the probability of the conditions and constraints. This probability becomes the denominator in a subsequent algorithm that takes the named evidence whose probability you want to compute. Several shortcut ways of achieving this are provided.
Algorithms that provide a query for the probability of some named evidence
Algorithms that compute conditional probabilities of queries over elements in a universe.
Class of responses to services.
Class of services implemented by the anytime algorithm.
Object for computing the range of values of elements in a universe.
Object for computing the range of values of elements in a universe. If an element has an abstraction, it computes the abstract values. Although the implementation uses lazy values, values are computed to maximum depth, so that a set of ordinary values is returned.
Trait of elements for which range of values can be computed.
Trait of elements for which range of values can be computed. Elements that implement this trait must implement the makeValues method.
Constructors for Abstraction
Ack Response (String)
Algorithms can be instructed to use an abstraction scheme to reason about an element (see AbstractionScheme.scala). This is achieved by adding an Abstraction pragma to the element. This pragma can be created most simply by calling Abstraction(numAbstractPoints), which specifies the desired number of abstract points for the abstraction. If an implicit abstraction scheme has been defined for the type of element, it will be used implicitly here. Otherwise, to specify that scheme should be used, call Abstraction(numAbstractPoints)(scheme).
Abstraction also takes an optional second argument, which is numConcretePointsPerAbstractPoint. This argument is used to generate the sample concrete points from which the abstract points are selected, in case the full set of concrete points cannot be generated (e.g., for continuous elements). The value of this argument is multiplied by the number of abstract points to determine the total number of concrete points. The default value for this argument is 10. This is indicated by attaching an Abstraction to the element.