org.activemath.studentmodel2.assessment.tbm
Class HypothesesContainer

java.lang.Object
  extended by org.activemath.studentmodel2.assessment.tbm.HypothesesContainer

public class HypothesesContainer
extends Object

This Class contains a set of hypotheses


Constructor Summary
HypothesesContainer()
          Empty default constructor
 
Method Summary
 void add(Hypothesis newHypothesis)
          Add new hypothesis to the container
 void addMass(long atomsBitMask, double beliefMass)
          Add more mass to a certain belief (hypothesis)
 void addUncertainty(double mass, int hypCnt)
          Add uncertainty to the current hypothesis.
 void applyWeight(double weight)
          Apply some weighting to a normalized hypothesis (Att: only call when container has already been normalized!!!
 HypothesesContainer deepcopy()
           
 long getAtoms()
          Return a long that has bits [0..n] set according to the set atoms
 List getHypotheses()
          Get all contained hypotheses
 Hypothesis getHypothesis(long atoms)
          get a specific hypothesis that these atoms set
 double getMinProbability()
          Returns the minimal probability of any contained hypothesis
 boolean hasAtom(long atom)
          See if any contained Hypothesis gives information about an atom, e.g.
 void normalize()
          Normalize the belief masses/probabilities in this Collection
 void reduceProbabilities(double mass)
           
 String toString()
          Returns the bitmask of defined hypotheses and the list of contained hypotheses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HypothesesContainer

public HypothesesContainer()
Empty default constructor

Method Detail

add

public void add(Hypothesis newHypothesis)
Add new hypothesis to the container

Parameters:
newHypothesis - - the new hypothesis

getHypotheses

public List getHypotheses()
Get all contained hypotheses

Returns:
A set of Hypothesis

hasAtom

public boolean hasAtom(long atom)
See if any contained Hypothesis gives information about an atom, e.g. {I, II} would return true for I or II, but false for o, III or IV.

Parameters:
atom - - the longValue() of a competencyLevel
Returns:
- true if any hypothesis contains the atom, else false

getMinProbability

public double getMinProbability()
Returns the minimal probability of any contained hypothesis

Returns:
- The minimal probability [0,1]

reduceProbabilities

public void reduceProbabilities(double mass)
Parameters:
mass - - The mass by which the probability has to be reduced

getAtoms

public long getAtoms()
Return a long that has bits [0..n] set according to the set atoms

Returns:
- a bitmask of atoms

getHypothesis

public Hypothesis getHypothesis(long atoms)
get a specific hypothesis that these atoms set

Parameters:
atoms - - bitmask of set atoms
Returns:
The corresponding Hypothesis if contained, else null

addMass

public void addMass(long atomsBitMask,
                    double beliefMass)
Add more mass to a certain belief (hypothesis)

Parameters:
atomsBitMask -
beliefMass -

normalize

public void normalize()
Normalize the belief masses/probabilities in this Collection


applyWeight

public void applyWeight(double weight)
Apply some weighting to a normalized hypothesis (Att: only call when container has already been normalized!!! No checking!)

Parameters:
weight - - the weight to be applied

addUncertainty

public void addUncertainty(double mass,
                           int hypCnt)
Add uncertainty to the current hypothesis. This will add some uncertainty to the hypothesis consisting of all possible atomic hypotheses. The amount of uncertainty added will reduce the weight of the other hypotheses. The initial weight of all hypotheses is 1. Adding an uncertainty of 1 will reduce the weight of the other hypotheses to 0.5, since 1 + 1 = 2 and after normalizing to 1 we receive 0.5 + 0.5.

Parameters:
mass - - the amount of uncertainty to add
hypCnt - - the amount of hypotheses possible

deepcopy

public HypothesesContainer deepcopy()

toString

public String toString()
Returns the bitmask of defined hypotheses and the list of contained hypotheses.

Overrides:
toString in class Object
See Also:
Object.toString()