All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cra.figaro.algorithm.OneTimeBoundsProbQuery.scala Maven / Gradle / Ivy

The newest version!
/*
 * OneTimeBoundsProbQuery.scala
 * One-time algorithms that compute bounds on conditional probabilities of query elements.
 *
 * Created By:      William Kretschmer ([email protected])
 * Creation Date:   Jun 23, 2017
 *
 * Copyright 2017 Avrom J. Pfeffer and Charles River Analytics, Inc.
 * See http://www.cra.com or email [email protected] for information.
 *
 * See http://www.github.com/p2t2/figaro for a copy of the software license.
 */
package com.cra.figaro.algorithm

import com.cra.figaro.language._

/**
 * 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.
 */
trait OneTimeBoundsProbQuery extends BoundsProbQueryAlgorithm with OneTimeProbQuery {
  protected def doAllProbabilityBounds[T](target: Element[T]): Stream[(Double, Double, T)] = {
    computeAllProbabilityBounds(target)
  }

  protected def doExpectationBounds[T](target: Element[T], function: T => Double, bounds: Option[(Double, Double)]): (Double, Double) = {
    computeExpectationBounds(target, function, bounds)
  }

  protected def doProbabilityBounds[T](target: Element[T], predicate: T => Boolean): (Double, Double) = {
    computeProbabilityBounds(target, predicate)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy