Class RpclProbabilityDistribution<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>>

  • Type Parameters:
    T - the type of interpretations
    All Implemented Interfaces:
    Map<T,​net.sf.tweety.math.probability.Probability>, net.sf.tweety.commons.Interpretation<RpclBeliefSet,​RelationalProbabilisticConditional>
    Direct Known Subclasses:
    CondensedProbabilityDistribution

    public class RpclProbabilityDistribution<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>>
    extends net.sf.tweety.commons.AbstractInterpretation<RpclBeliefSet,​RelationalProbabilisticConditional>
    implements Map<T,​net.sf.tweety.math.probability.Probability>
    Objects of this class represent probability distributions on the interpretations of an underlying first-order signature for a relational probabilistic conditional knowledge base.
    Author:
    Matthias Thimm
    • Constructor Detail

      • RpclProbabilityDistribution

        public RpclProbabilityDistribution​(RpclSemantics semantics,
                                           net.sf.tweety.logics.fol.syntax.FolSignature signature)
        Creates a new probability distribution for the given signature.
        Parameters:
        semantics - the used RPCL semantics
        signature - a fol signature.
    • Method Detail

      • getSemantics

        public RpclSemantics getSemantics()
        Returns the semantics of this distribution.
        Returns:
        the semantics of this distribution.
      • probability

        public net.sf.tweety.math.probability.Probability probability​(net.sf.tweety.logics.fol.syntax.FolFormula f)
        Gets the probability of the given closed formula, i.e. the sum of the probabilities of all interpretations satisfying it.
        Parameters:
        f - a closed fol formula.
        Returns:
        a probability.
      • probability

        public net.sf.tweety.math.probability.Probability probability​(net.sf.tweety.logics.rcl.syntax.RelationalConditional re)
        Gets the probability of the given closed relational conditional "re", i.e. the probability of the head of "re" given its body.
        Parameters:
        re - a closed relational conditional.
        Returns:
        a probability.
      • entropy

        public double entropy()
        Returns the entropy of this probability distribution.
        Returns:
        the entropy of this probability distribution.
      • convexCombination

        public RpclProbabilityDistribution<T> convexCombination​(double d,
                                                                RpclProbabilityDistribution<T> other)
        Computes the convex combination of this P1 and the given probability distribution P2 with parameter d, i.e. it returns a P with P(i)=d P1(i) + (1-d) P2(i) for every interpretation i.
        Parameters:
        d - a double
        other - a probability distribution
        Returns:
        the convex combination of this P1 and the given probability distribution P2 with parameter d.
        Throws:
        IllegalArgumentException - if either d is not in [0,1] or this and the given probability distribution are not defined on the same set of interpretations.
      • getUniformDistribution

        public static RpclProbabilityDistribution<net.sf.tweety.logics.fol.semantics.HerbrandInterpretation> getUniformDistribution​(RpclSemantics semantics,
                                                                                                                                    net.sf.tweety.logics.fol.syntax.FolSignature signature)
        Returns the uniform distribution on the given signature.
        Parameters:
        semantics - the semantics for the distribution.
        signature - a fol signature
        Returns:
        the uniform distribution on the given signature.
      • clear

        public void clear()
        Specified by:
        clear in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • containsValue

        public boolean containsValue​(Object value)
        Specified by:
        containsValue in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • entrySet

        public Set<Map.Entry<T,​net.sf.tweety.math.probability.Probability>> entrySet()
        Specified by:
        entrySet in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • get

        public net.sf.tweety.math.probability.Probability get​(Object key)
        Specified by:
        get in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • put

        public net.sf.tweety.math.probability.Probability put​(T key,
                                                              net.sf.tweety.math.probability.Probability value)
        Specified by:
        put in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • putAll

        public void putAll​(Map<? extends T,​? extends net.sf.tweety.math.probability.Probability> m)
        Specified by:
        putAll in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • remove

        public net.sf.tweety.math.probability.Probability remove​(Object key)
        Specified by:
        remove in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • size

        public int size()
        Specified by:
        size in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • values

        public Collection<net.sf.tweety.math.probability.Probability> values()
        Specified by:
        values in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • keySet

        public Set<T> keySet()
        Specified by:
        keySet in interface Map<T extends net.sf.tweety.commons.Interpretation<net.sf.tweety.logics.fol.syntax.FolBeliefSet,​net.sf.tweety.logics.fol.syntax.FolFormula>,​net.sf.tweety.math.probability.Probability>
      • getSignature

        public net.sf.tweety.commons.Signature getSignature()
        Returns the signature of the underlying language.
        Returns:
        the signature of the underlying language.