p

# algorithm 

Ordering
1. Alphabetic
Visibility
1. Public
2. All

### Type Members

1. class Abstraction [T] extends Pragma[T]

Algorithms can be instructed to use an abstraction scheme to reason about an element (see AbstractionScheme.scala).

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.

2. trait AbstractionScheme [T] extends PointMapper[T]

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.

3. trait Algorithm extends AnyRef

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.

4. class
5. class AlgorithmException extends RuntimeException
6. class
7. trait Anytime extends Algorithm

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.

8. class AnytimeAlgorithmException extends RuntimeException
9. trait

One-time algorithms that compute bounds on conditional probabilities of query elements.

One-time algorithms that compute bounds on conditional probabilities of query elements. A class that implements this trait must implement initialize, runStep, computeAllProbabilityBounds, and computeExpectationBounds methods.

10. trait AnytimeMPE extends MPEAlgorithm with Anytime

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.

11. trait AnytimeProbEvidence extends ProbEvidenceAlgorithm with Anytime

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.

12. trait AnytimeProbQuery extends ProbQueryAlgorithm with Anytime

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.

13. trait BaseProbQueryAlgorithm [U[_]] extends Algorithm

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.

14. trait

Algorithms that compute bounds on conditional probabilities of queries over elements in a universe.

Algorithms that compute bounds on conditional probabilities of queries over elements in a universe. The regular ProbQuery methods are also available, but these methods may throw an exception if the algorithm cannot produce an exact answer.

15. case class ExceptionResponse (msg: String) extends Response with Product with Serializable

Exception Response (String)

16. case class Handle (service: Service) extends Message with Product with Serializable

A message to the handler to handle the given service.

17. trait LazyAlgorithm extends Algorithm

A lazy algorithm is an algorithm that can be run to increasing depths.

18. trait MPEAlgorithm extends Algorithm

Algorithms that compute the most likely values of elements.

19. sealed abstract class Message extends AnyRef

Messages to or from the actor.

20. trait OneTime extends Algorithm

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.

21. trait

One-time algorithms that compute bounds on conditional probabilities of query elements.

One-time algorithms that compute bounds on conditional probabilities of query elements. A class that implements this trait must implement run, computeAllProbabilityBounds, and computeExpectationBounds methods.

22. trait OneTimeMPE extends MPEAlgorithm with OneTime

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.

23. trait OneTimeProbEvidence extends ProbEvidenceAlgorithm with OneTime

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.

24. trait OneTimeProbQuery extends ProbQueryAlgorithm with OneTime

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.

25. trait ParameterLearner extends AnyRef

Trait of algorithms that learn parameters.

26. trait PointMapper [T] extends AnyRef

Trait of functions that map concrete points to abstract points.

27. case class Predicate [T](element: Element[T], fn: (T) ⇒ Boolean) extends Product with Serializable

A predicate defined on an element.

28. trait ProbEvidenceAlgorithm extends Algorithm

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.

29. trait ProbEvidenceQuery extends AnyRef

Algorithms that provide a query for the probability of some named evidence

30. trait

Algorithms that compute conditional probabilities of queries over elements in a universe.

31. abstract class Response extends AnyRef

Class of responses to services.

32. abstract class Service extends AnyRef

Class of services implemented by the anytime algorithm.

33. trait
34. class UnsupportedAlgorithmException extends RuntimeException
35. class Values extends AnyRef

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.

36. trait ValuesMaker [T] extends Element[T]

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.

### Value Members

1. object

Constructors for Abstraction

2. object
3. object AckResponse extends Response with Product with Serializable

Ack Response (String)

4. object
5. object