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

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

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

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

    General Response (String)

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

    A message to the handler to handle the given service.

  13. trait LazyAlgorithm extends Algorithm

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

  14. trait MPEAlgorithm extends Algorithm

    Algorithms that compute the most likely values of elements.

  15. sealed abstract class Message extends AnyRef

    Messages to or from the actor.

  16. class NotATargetException[T] extends AlgorithmException

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

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

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

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

  21. trait ParameterLearner extends AnyRef

    Trait of algorithms that learn parameters.

  22. trait PointMapper[T] extends AnyRef

    Trait of functions that map concrete points to abstract points.

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

    A predicate defined on an element.

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

  25. trait ProbQueryAlgorithm extends Algorithm

    Algorithms that compute conditional probabilities of queries.

  26. abstract class Response extends AnyRef

    Class of responses to services.

  27. abstract class Service extends AnyRef

    Class of services implemented by the anytime algorithm.

  28. class UnsupportedAlgorithmException extends RuntimeException

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

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

  4. object Values

  5. package decision

  6. package factored

  7. package filtering

  8. package lazyfactored

  9. package learning

  10. package sampling

Ungrouped