package algorithm
 Alphabetic
 Public
 All
Type Members

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.

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.

trait
Algorithm
extends AnyRef
The general class of Figaro algorithms.
The general class of Figaro algorithms. The Algorithm class is defined to generalize both onetime and anytime algorithms, using a start/stop/resume/kill mechanism.
 class AlgorithmActiveException extends AlgorithmException
 class AlgorithmException extends RuntimeException
 class AlgorithmInactiveException extends AlgorithmException

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.
 class AnytimeAlgorithmException extends RuntimeException

trait
AnytimeBoundsProbQuery
extends BoundsProbQueryAlgorithm with AnytimeProbQuery
Onetime algorithms that compute bounds on conditional probabilities of query elements.
Onetime algorithms that compute bounds on conditional probabilities of query elements. A class that implements this trait must implement initialize, runStep, computeAllProbabilityBounds, and computeExpectationBounds methods.

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.

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.

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.

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.

trait
BoundsProbQueryAlgorithm
extends ProbQueryAlgorithm
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.

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

case class
Handle
(service: Service) extends Message with Product with Serializable
A message to the handler to handle the given service.

trait
LazyAlgorithm
extends Algorithm
A lazy algorithm is an algorithm that can be run to increasing depths.

trait
MPEAlgorithm
extends Algorithm
Algorithms that compute the most likely values of elements.

sealed abstract
class
Message
extends AnyRef
Messages to or from the actor.

trait
OneTime
extends Algorithm
A onetime algorithm runs in a single step to produce its answers.
A onetime 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.

trait
OneTimeBoundsProbQuery
extends BoundsProbQueryAlgorithm with OneTimeProbQuery
Onetime algorithms that compute bounds on conditional probabilities of query elements.
Onetime algorithms that compute bounds on conditional probabilities of query elements. A class that implements this trait must implement run, computeAllProbabilityBounds, and computeExpectationBounds methods.

trait
OneTimeMPE
extends MPEAlgorithm with OneTime
Onetime algorithms that compute the most likely values of elements.
Onetime algorithms that compute the most likely values of elements. A class that implements this trait must implement run and mostLikelyValue methods.

trait
OneTimeProbEvidence
extends ProbEvidenceAlgorithm with OneTime
Onetime algorithms that compute probability of evidence.
Onetime algorithms that compute probability of evidence. A class that implements this trait must implement the run and computeprobEvidence methods.

trait
OneTimeProbQuery
extends ProbQueryAlgorithm with OneTime
Onetime algorithms that compute conditional probability of query elements.
Onetime algorithms that compute conditional probability of query elements. A class that implements this trait must implement run, computeDistribution, and computeExpectation methods.

trait
ParameterLearner
extends AnyRef
Trait of algorithms that learn parameters.

trait
PointMapper
[T] extends AnyRef
Trait of functions that map concrete points to abstract points.

case class
Predicate
[T](element: Element[T], fn: (T) ⇒ Boolean) extends Product with Serializable
A predicate defined on an element.

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.

trait
ProbEvidenceQuery
extends AnyRef
Algorithms that provide a query for the probability of some named evidence

trait
ProbQueryAlgorithm
extends BaseProbQueryAlgorithm[Element]
Algorithms that compute conditional probabilities of queries over elements in a universe.

abstract
class
Response
extends AnyRef
Class of responses to services.

abstract
class
Service
extends AnyRef
Class of services implemented by the anytime algorithm.
 trait StreamableProbQueryAlgorithm extends ProbQueryAlgorithm
 class UnsupportedAlgorithmException extends RuntimeException

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.

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

object
Abstraction
Constructors for Abstraction
 object AbstractionScheme

object
AckResponse
extends Response with Product with Serializable
Ack Response (String)
 object PointMapper
 object Values