com.cra.figaro

algorithm

package algorithm

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 AlgorithmActiveException extends AlgorithmException

  5. class AlgorithmException extends RuntimeException

  6. class AlgorithmInactiveException extends AlgorithmException

  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 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.

  10. 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.

  11. 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.

  12. 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.

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

    Exception Response (String)

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

    A message to the handler to handle the given service.

  15. trait LazyAlgorithm extends Algorithm

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

  16. trait MPEAlgorithm extends Algorithm

    Algorithms that compute the most likely values of elements.

  17. sealed abstract class Message extends AnyRef

    Messages to or from the actor.

  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. trait ParameterLearner extends AnyRef

    Trait of algorithms that learn parameters.

  23. trait PointMapper[T] extends AnyRef

    Trait of functions that map concrete points to abstract points.

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

    A predicate defined on an element.

  25. 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.

  26. trait ProbEvidenceQuery extends AnyRef

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

  27. trait ProbQueryAlgorithm extends BaseProbQueryAlgorithm[Element]

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

  28. abstract class Response extends AnyRef

    Class of responses to services.

  29. abstract class Service extends AnyRef

    Class of services implemented by the anytime algorithm.

  30. class UnsupportedAlgorithmException extends RuntimeException

  31. 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.

  32. 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 Abstraction

    Constructors for Abstraction

  2. object AbstractionScheme

  3. object AckResponse extends Response with Product with Serializable

    Ack Response (String)

  4. object PointMapper

  5. object Values

  6. package decision

  7. package factored

  8. package filtering

  9. package lazyfactored

  10. package learning

  11. package online

  12. package sampling

Ungrouped