it.unibo.cs.belief
Class TreeMassPotential

java.lang.Object
  extended by it.unibo.cs.belief.TreeMassPotential
All Implemented Interfaces:
MassPotential

public class TreeMassPotential
extends java.lang.Object
implements MassPotential

An efficient implementation of a mass potential based on a tree map.

Version:
0.1
Author:
Matteo Magnani

Field Summary
protected  Proposition core
           
protected  java.util.Map focalSets
           
protected  Frame frame
           
 
Constructor Summary
TreeMassPotential(Frame frame)
           
 
Method Summary
 void addEvidence(Proposition prop, double mass)
          Assigns some evidence (mass) to a proposition.
 void applyThreshold(double threshold)
          Deletes all mass assignments under the specified value.
 void condition(Proposition prop)
          Conditions this mass potential to a subset of the frame.
 boolean equals(java.lang.Object mp)
           
 Proposition getCore()
          Returns the intersection of all the proposition to which this mass potential assigns some mass.
 double getEvidence(Proposition prop)
          Returns the evidence assigned to a proposition so far.
 java.util.Set getFocalSets()
          Returns the set of propositions to whom some evidence has been assigned.
 Frame getFrame()
          Returns the set of all possible elementary events from which propositions are composed.
 int hashCode()
           
 void normalize()
          Transforms this mass potential into a mass function.
 Proposition pick(java.util.Random ran)
           
 BeliefFunction toBeliefFunction()
          Produces the belief function corresponding to this mass potential.
 CommonalityFunction toCommonalityFunction()
          Produces the commonality function corresponding to this mass potential.
 PlausibilityFunction toPlausibilityFunction()
          Produces the plausibility function corresponding to this mass potential.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

frame

protected Frame frame

core

protected Proposition core

focalSets

protected java.util.Map focalSets
Constructor Detail

TreeMassPotential

public TreeMassPotential(Frame frame)
Method Detail

equals

public boolean equals(java.lang.Object mp)
Specified by:
equals in interface MassPotential
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

addEvidence

public void addEvidence(Proposition prop,
                        double mass)
Description copied from interface: MassPotential
Assigns some evidence (mass) to a proposition. If some mass has already been assigned to the same proposition, the new mass is added to the previous value. Mass potentials are not normalized, so it is not necessary to assign exactly one unit of mass. If A and B are two propositions, the assignments m1(A)=80, m1(B)=40 and m2(A)=3, m2(B)=1.5 correspond to the same mass function.

Specified by:
addEvidence in interface MassPotential
Parameters:
prop - the proposition to which the evidence is assigned
mass - the evidence assigned to the proposition

getEvidence

public double getEvidence(Proposition prop)
Description copied from interface: MassPotential
Returns the evidence assigned to a proposition so far.

Specified by:
getEvidence in interface MassPotential
Parameters:
prop - the proposition we want to check
Returns:
the evidence assigned to the proposition

normalize

public void normalize()
Description copied from interface: MassPotential
Transforms this mass potential into a mass function. A mass function m is a particular case of mass potential, where no mass is assigned to the empty set and the sum of all mass is equal to one. Because of numerical approximation the sum may not be exactly one.

Specified by:
normalize in interface MassPotential

getFocalSets

public java.util.Set getFocalSets()
Description copied from interface: MassPotential
Returns the set of propositions to whom some evidence has been assigned. These propositions are usually called focal sets. After normalization (normalize()) the empty proposition is not returned by this method.

Specified by:
getFocalSets in interface MassPotential
Returns:
the set of focal sets of this mass potential

getFrame

public Frame getFrame()
Description copied from interface: MassPotential
Returns the set of all possible elementary events from which propositions are composed. This set is usually called a frame of discernment.

Specified by:
getFrame in interface MassPotential
Returns:
the frame whose powerset is the domain of this mass potential

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCore

public Proposition getCore()
Description copied from interface: MassPotential
Returns the intersection of all the proposition to which this mass potential assigns some mass.

Specified by:
getCore in interface MassPotential
Returns:
the core of the mass potential, i.e., the intersection of its focal sets.

condition

public void condition(Proposition prop)
Description copied from interface: MassPotential
Conditions this mass potential to a subset of the frame. The new mass potential is obtained assuming that the proposition on which it has been conditioned is true.

Specified by:
condition in interface MassPotential
Parameters:
prop - the proposition on which this mass potential is conditioned

applyThreshold

public void applyThreshold(double threshold)
Description copied from interface: MassPotential
Deletes all mass assignments under the specified value.

Specified by:
applyThreshold in interface MassPotential
Parameters:
threshold - the minimum value of mass that is retained

toBeliefFunction

public BeliefFunction toBeliefFunction()
Produces the belief function corresponding to this mass potential.

This method is an implementation of the Fast Möbius Transformation.

Specified by:
toBeliefFunction in interface MassPotential
Returns:
a belief function

toPlausibilityFunction

public PlausibilityFunction toPlausibilityFunction()
Description copied from interface: MassPotential
Produces the plausibility function corresponding to this mass potential.

Specified by:
toPlausibilityFunction in interface MassPotential
Returns:
a plausibility function

toCommonalityFunction

public CommonalityFunction toCommonalityFunction()
Description copied from interface: MassPotential
Produces the commonality function corresponding to this mass potential.

Specified by:
toCommonalityFunction in interface MassPotential
Returns:
a commonality function

pick

public Proposition pick(java.util.Random ran)
Specified by:
pick in interface MassPotential