|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectEvidenceController
public class EvidenceController
Field Summary | |
---|---|
static boolean |
FLAG_DEBUG
|
static String |
STR_ERR_MSG_FROZEN
|
Constructor Summary | |
---|---|
EvidenceController(BeliefNetwork bn)
|
Method Summary | |
---|---|
void |
addEvidenceChangeListener(EvidenceChangeListener ecl)
|
void |
addPriorityEvidenceChangeListener(EvidenceChangeListener ecl)
|
Object |
clone()
|
Map |
evidence()
Returns the set of variable to value instantiations. |
Set |
evidenceVariables()
|
BeliefNetwork |
getBeliefNetwork()
|
List |
getPriorityEvidenceChangeListeners(List ret)
|
Object |
getValue(Variable observed)
|
boolean |
isEmpty()
|
boolean |
isFrozen()
|
int |
notifyNonPriorityListeners()
Fire evidenceChanged() event when evidence has not actually changed, usually when the computed query answer has changed for some other reason, and you want registered listeners to know about it. |
int |
observe(FiniteVariable var,
Object value)
Add var=value to the list of observations. |
int |
observe(Map evidence)
Adds the observations listed to the set of current observations |
int |
observeNotifyOnlyPriorityListeners(FiniteVariable var,
Object value)
|
boolean |
removeEvidenceChangeListener(EvidenceChangeListener ecl)
|
boolean |
removePriorityEvidenceChangeListener(EvidenceChangeListener ecl)
|
Object |
removeVariable(Variable var)
|
int |
replaceVariables(Map mapVariablesOldToNew)
|
int |
resetEvidence()
Restores the evidence to the state of no observations. |
void |
setBeliefNetwork(BeliefNetwork bn)
|
void |
setFrozen(boolean frozen)
Freeze evidence. |
void |
setNotifyEnabled(boolean enabled)
Use this method to disable/re-enable evidence change events. |
int |
setObservations(Map evidence)
This differs from observe(Map evidence) in that the
old observations are completely removed, and replaced by the current
evidence. |
int |
size()
|
int |
unobserve(FiniteVariable var)
Sets the state of the variable to unobserved. |
int |
unobserveNotifyOnlyPriorityListeners(FiniteVariable var)
|
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean FLAG_DEBUG
public static final String STR_ERR_MSG_FROZEN
Constructor Detail |
---|
public EvidenceController(BeliefNetwork bn)
Method Detail |
---|
public void setFrozen(boolean frozen)
public boolean isFrozen()
public void setNotifyEnabled(boolean enabled)
Use this method to disable/re-enable evidence change events.
If you disable evidence change events, you must remember to re-enable them before other evidence change listeners make changes.
public Object removeVariable(Variable var)
public Object getValue(Variable observed)
public List getPriorityEvidenceChangeListeners(List ret)
public void addPriorityEvidenceChangeListener(EvidenceChangeListener ecl)
public boolean removePriorityEvidenceChangeListener(EvidenceChangeListener ecl)
public void addEvidenceChangeListener(EvidenceChangeListener ecl)
public boolean removeEvidenceChangeListener(EvidenceChangeListener ecl)
public int notifyNonPriorityListeners()
public int observe(FiniteVariable var, Object value) throws StateNotFoundException
StateNotFoundException
public int observeNotifyOnlyPriorityListeners(FiniteVariable var, Object value) throws StateNotFoundException
StateNotFoundException
public int observe(Map evidence) throws StateNotFoundException
evidence
- A mapping from FiniteVariables to the value they take on.
StateNotFoundException
public int setObservations(Map evidence) throws StateNotFoundException
observe(Map evidence)
in that the
old observations are completely removed, and replaced by the current
evidence. For example, if the old evidence state was {X=a,Y=b}, calling
setObservations({Y=c,Z=d}) would produce the observation set {Y=c,Z=d}.
StateNotFoundException
public int unobserve(FiniteVariable var)
public int unobserveNotifyOnlyPriorityListeners(FiniteVariable var)
public int resetEvidence()
public Map evidence()
public int size()
public Set evidenceVariables()
public boolean isEmpty()
public int replaceVariables(Map mapVariablesOldToNew)
public Object clone()
clone
in class Object
public void setBeliefNetwork(BeliefNetwork bn)
public BeliefNetwork getBeliefNetwork()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |