com.cra.figaro.library.decision

Decision

abstract class Decision[T, U] extends Chain[T, U] with PolicyMaker[T, U]

Linear Supertypes
PolicyMaker[T, U], Chain[T, U], Deterministic[U], Element[U], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Decision
  2. PolicyMaker
  3. Chain
  4. Deterministic
  5. Element
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Decision(name: Name[U], parent: Element[T], fcn: (T) ⇒ Element[U], cacheSize: Int, collection: ElementCollection)

Type Members

  1. type Condition = (U) ⇒ Boolean

    The type of conditions on the element.

    The type of conditions on the element. A condition is a function from a value to a Boolean.

    Definition Classes
    Element
  2. type Constraint = (U) ⇒ Double

    The type of soft constraints on the element.

    The type of soft constraints on the element. A constraint is a function from a value to a Double.

    Definition Classes
    Element
  3. type DValue = U

    The decision type

  4. type PValue = T

    The parent type

  5. type ParentType = T

    The type of the parent argument.

    The type of the parent argument.

    Definition Classes
    Chain
  6. type Randomness = Null

    The type of randomness content of the element.

    The type of randomness content of the element.

    Definition Classes
    DeterministicElement
  7. type Value = U

    The type of values over which the element is defined.

    The type of values over which the element is defined.

    Definition Classes
    Element

Abstract Value Members

  1. abstract def makePolicy(policyMap: Map[(T, U), DecisionSample]): DecisionPolicy[T, U]

    Returns a DecisionPolicy from a map of parent/decision tuple values to DecisionSamples

    Returns a DecisionPolicy from a map of parent/decision tuple values to DecisionSamples

    Definition Classes
    PolicyMaker

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. def !==(that: Element[Value])(implicit universe: Universe): Neq[Value]

    The element that tests inequality of this element with another element.

    The element that tests inequality of this element with another element.

    Definition Classes
    Element
  4. final def ##(): Int

    Definition Classes
    AnyRef → Any
  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. def ===(that: Value)(implicit universe: Universe): Apply1[U, Boolean]

    The element that tests whether the value of this element is equal to a particular value.

    The element that tests whether the value of this element is equal to a particular value.

    Definition Classes
    Element
  8. def ===(that: Element[Value])(implicit universe: Universe): Eq[Value]

    The element that tests equality of this element with another element.

    The element that tests equality of this element with another element.

    Definition Classes
    Element
  9. def activate(): Unit

    Activate the element in its universe.

    Activate the element in its universe.

    Definition Classes
    Element
  10. var active: Boolean

    Flag indicating whether the element is currently active in its universe.

    Flag indicating whether the element is currently active in its universe.

    Definition Classes
    Element
  11. def addCondition(condition: (U) ⇒ Boolean, contingency: Contingency = List()): Unit

    Add the given condition to the existing conditions of the element.

    Add the given condition to the existing conditions of the element. By default, the contingency is empty.

    Definition Classes
    Element
  12. def addConstraint(constraint: (U) ⇒ Double, contingency: Contingency = List()): Unit

    Add a contingent constraint to the element.

    Add a contingent constraint to the element. By default, the contingency is empty.

    Definition Classes
    Element
  13. def addLogConstraint(constraint: (U) ⇒ Double, contingency: Contingency = List()): Unit

    Add a log contingent constraint to the element.

    Add a log contingent constraint to the element. By default, the contingency is empty.

    Definition Classes
    Element
  14. def addPragma(pragma: Pragma[Value]): Unit

    Add a pragma to the element.

    Add a pragma to the element.

    Definition Classes
    Element
  15. def allConditions: List[((U) ⇒ Boolean, Contingency)]

    All the conditions defined on this element.

    All the conditions defined on this element.

    Definition Classes
    Element
  16. def allConstraints: List[((U) ⇒ Double, Contingency)]

    The current soft constraints on the element.

    The current soft constraints on the element.

    Definition Classes
    Element
  17. def args: List[Element[_]]

    The arguments on which the element depends.

    The arguments on which the element depends.

    Definition Classes
    ChainElement
  18. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  19. def clearContext(): Unit

    Clears all the temporary elements associated with this element (all elements created in it's context)

    Clears all the temporary elements associated with this element (all elements created in it's context)

    Definition Classes
    ChainElement
  20. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def condition(value: Any): Boolean

    Tests whether all the element's contingent conditions are satisfied for the given value.

    Tests whether all the element's contingent conditions are satisfied for the given value.

    Definition Classes
    Element
  22. def conditionSatisfied: Boolean

    Determines whether the condition on the element is satisfied by the current value.

    Determines whether the condition on the element is satisfied by the current value.

    Definition Classes
    Element
  23. def constraint(value: Any): Double

    Gets the result of all the element's contingent constraints for the given value.

    Gets the result of all the element's contingent constraints for the given value.

    Definition Classes
    Element
  24. def constraintValue: Double

    Determines the value of the constraint on the element applied to the current value.

    Determines the value of the constraint on the element applied to the current value.

    Definition Classes
    Element
  25. def context: List[Element[_]]

    The elements on which the existence of this element depends

    The elements on which the existence of this element depends

    Definition Classes
    Element
  26. def cpd: (T) ⇒ Element[U]

    The decision function.

    The decision function. fcn is declared as a var and can change depending on the policy

    Attributes
    protected
    Definition Classes
    DecisionChain
  27. def deactivate(): Unit

    Deactivate the element in its universe.

    Deactivate the element in its universe.

    Definition Classes
    Element
  28. def directContextContents: Set[Element[_]]

    Returns the set of elements directly created in the context of this element

    Returns the set of elements directly created in the context of this element

    Definition Classes
    ChainElement
  29. def elementsIAmContingentOn: Set[Element[_]]

    Definition Classes
    Element
  30. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  32. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. def flatMap[U](fn: (Value) ⇒ Element[U])(implicit name: Name[U], collection: ElementCollection): Element[U]

    Definition Classes
    Element
  34. final def generate(): Unit

    First generate the randomness, then generate the value given the randomness.

    First generate the randomness, then generate the value given the randomness. Store the results in randomness and value.

    Definition Classes
    Element
  35. def generateRandomness(): Null

    Generate the randomness content.

    Generate the randomness content.

    Definition Classes
    DeterministicElement
  36. def generateValue(): U

    Generate a value with no randomness.

    Generate a value with no randomness.

    Definition Classes
    ChainDeterministic
  37. def generateValue(rand: Randomness): Value

    Generate the value of the element determinstically given its randomness and the values of its arguments.

    Generate the value of the element determinstically given its randomness and the values of its arguments.

    Definition Classes
    DeterministicElement
  38. def get(parentValue: T): Element[U]

    Get the distribution over the result corresponding to the given parent value.

    Get the distribution over the result corresponding to the given parent value. Takes care of all bookkeeping including caching.

    Definition Classes
    Chain
  39. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  40. def getPolicy(): DecisionPolicy[T, U]

    Get the complete policy object for this decision

  41. def getPolicy(p: T): Element[U]

    Get the decision for a specific value of the parent

  42. val hashCode: Int

    Definition Classes
    Element → AnyRef → Any
  43. def isCachable(): Boolean

    The cacheability of the element.

    The cacheability of the element. Chains create caches of their parent values, and it is useful to know when these values can be effectively cached and reused. In general, continuous distributions are not cacheable

    Definition Classes
    Element
  44. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  45. def isTemporary: Boolean

    Returns true if this element is temporary, that is, was created in the context of another element

    Returns true if this element is temporary, that is, was created in the context of another element

    Definition Classes
    Element
  46. def makePolicy(alg: DecisionAlgorithm[T, U]): DecisionPolicy[T, U]

    Returns a DecisionPolicy from the given decision algorithm

    Returns a DecisionPolicy from the given decision algorithm

    Definition Classes
    PolicyMaker
  47. def map[U](fn: (Value) ⇒ U)(implicit name: Name[U], collection: ElementCollection): Element[U]

    Definition Classes
    Element
  48. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  49. def nextRandomness(rand: Randomness): (Randomness, Double, Double)

    Generate the next randomness given the current randomness.

    Generate the next randomness given the current randomness. Returns three values: The next randomness, the Metropolis-Hastings proposal probability ratio, which is

    P(new -> old) / P(old -> new)

    and the model probability ratio, which is

    P(new) / P(old)

    The default implementation is to use generateRandomness and returns ones for the proposal and model probability ratios.

    Definition Classes
    Element
  50. final def notify(): Unit

    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  52. def observe(observation: Value): Unit

    Condition the element by observing a particular value.

    Condition the element by observing a particular value. Propagates the effect to dependent elements and ensures that no other value for the element can be generated.

    Definition Classes
    Element
  53. def pragmas: List[Pragma[Value]]

    The pragmas attached to the element.

    The pragmas attached to the element.

    Definition Classes
    Element
  54. var randomness: Randomness

    The current randomness content of the element.

    The current randomness content of the element.

    Definition Classes
    Element
  55. def removeConditions(contingency: Contingency = List()): Unit

    Remove all conditions associated with the given contingency.

    Remove all conditions associated with the given contingency. By default, the contingency is empty.

    Definition Classes
    Element
  56. def removeConstraints(contingency: Contingency = List()): Unit

    Remove all constraints associated with the given contingency.

    Remove all constraints associated with the given contingency. By default, the contingency is empty.

    Definition Classes
    Element
  57. def removePragma(pragma: Pragma[Value]): Unit

    Remove a pragma from the element.

    Remove a pragma from the element.

    Definition Classes
    Element
  58. def resizeCache(dropValue: T): Map[T, Set[Element[_]]]

    Attributes
    protected
    Definition Classes
    Chain
  59. var resultElement: Element[U]

    The current result element that arises from the current value of the parent.

    The current result element that arises from the current value of the parent.

    Definition Classes
    Chain
  60. def score(oldValue: Value, newValue: Value): Double

    Compute the constraints on the new value divided by the constraints on the old value.

    Compute the constraints on the new value divided by the constraints on the old value.

    Definition Classes
    Element
  61. def set(newValue: Value): Unit

    Set the value of this element and propagate the effects to elements that depend on it without changing their randomness.

    Set the value of this element and propagate the effects to elements that depend on it without changing their randomness. Also disallows the value of the element to change until unobserve or unset is called.

    Definition Classes
    Element
  62. def setCondition(newCondition: (U) ⇒ Boolean, contingency: Contingency = List()): Unit

    Set the condition associated with the contingency.

    Set the condition associated with the contingency. Removes previous conditions associated with the contingency. By default, the contingency is empty.

    Definition Classes
    Element
  63. def setConstraint(newConstraint: (U) ⇒ Double, contingency: Contingency = List()): Unit

    Set the constraint associated with the contingency.

    Set the constraint associated with the contingency. Removes previous constraints associated with the contingency. By default, the contingency is empty.

    Definition Classes
    Element
  64. def setLogConstraint(newConstraint: (U) ⇒ Double, contingency: Contingency = List()): Unit

    Set the log constraint associated with the contingency.

    Set the log constraint associated with the contingency. Removes previous constraints associated with the contingency. By default, the contingency is empty.

    Definition Classes
    Element
  65. def setPolicy(new_fcn: (T) ⇒ Element[U]): Unit

    Directly set the policy of this decision using a function from a parent value to a decision element

  66. def setPolicy(policyMap: Map[(T, U), DecisionSample]): Unit

    Set the policy for this decision using a map from parent/decision tuple values to decision samples

  67. def setPolicy(Alg: DecisionAlgorithm[T, U]): Unit

    Set the policy for this decision from an Algorithm run on this decision

  68. def setPolicy(): Unit

    Set the policy for this decision using the DecisionPolicy class stored in the Decision

  69. def setRandomness(newRandomness: Randomness): Unit

    Set the randomness of this element.

    Set the randomness of this element.

    Will generate its value using the new randomness and propagate the effects to elements that depend on it without changing their randomness.

    Definition Classes
    Element
  70. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  71. def toNameString: String

    A string that is the element's name, if it has a non-empty one, otherwise the result of the element's toString

    A string that is the element's name, if it has a non-empty one, otherwise the result of the element's toString

    Definition Classes
    Element
  72. def toString(): String

    Definition Classes
    Chain → AnyRef → Any
  73. val universe: Universe

    The universe in which the element is defined.

    The universe in which the element is defined.

    Definition Classes
    Element
  74. def unobserve(): Unit

    Removes conditions on the element and allows different values of the element to be generated

    Removes conditions on the element and allows different values of the element to be generated

    Definition Classes
    Element
  75. def unset(): Unit

    Allows different values of the element to be generated.

    Allows different values of the element to be generated.

    Definition Classes
    Element
  76. var value: Value

    The current value of the element.

    The current value of the element.

    Definition Classes
    Element
  77. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from PolicyMaker[T, U]

Inherited from Chain[T, U]

Inherited from Deterministic[U]

Inherited from Element[U]

Inherited from AnyRef

Inherited from Any

Ungrouped