Package com.bayesserver.inference
Class DefaultEvidence
- java.lang.Object
-
- com.bayesserver.inference.DefaultEvidence
-
- All Implemented Interfaces:
Evidence
public final class DefaultEvidence extends Object implements Evidence
Represents the evidence, or case data (e.g. row in a database) used in aquery. Evidence is always associated with a particular network, however if necessary can be detached or attached to an instance of an inference engine. This has the follwing advantages: - Evidence can be set before an inference engine is created, or retained when an inference engine is destroyed. - Evidence can be switched between inference engines. - An inference engine can switch between different evidence instances.
-
-
Constructor Summary
Constructors Constructor Description DefaultEvidence(DefaultEvidence evidence)Initializes a new instance of theDefaultEvidenceclass, copying data from an existingDefaultEvidenceobject.DefaultEvidence(Evidence evidence)Initializes a new instance of theDefaultEvidenceclass, and copies the evidence from another instance.DefaultEvidence(Network network)Initializes a new instance of theDefaultEvidenceclass, with the target Bayesian network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginUpdate()Disables change notifications (if present), untilEvidence.endUpdate()is called.voidclear()Clears any evidence on all variables.voidclear(Node node)Clears evidence on a node's variables.voidclear(Node node, Integer time)Clears evidence on a node's single variable.voidclear(Variable variable)Clears any evidence on a variable.voidclear(Variable variable, Integer time)Clears evidence on a variable at the specified time.voidcopy(Evidence evidence)Replaces the current evidence, with that from anotherEvidenceinstance.voidcopy(Evidence evidence, Variable variable)Replaces the current evidence for an individual variable, with that from anotherEvidenceinstance.voidcopy(Evidence evidence, Variable variable, Integer time)Replaces the current evidence for an individual variable at a specific time, with that from anotherEvidenceinstance.voidendUpdate()Enables change notifications (if available).Doubleget(Node node)Gets the hard evidence value for a particular node's variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.voidget(Node node, Double[] destination, int destinationStart, int startTime, int count)Gets the evidence for a node's single temporal variable.Doubleget(Node node, Integer time)Gets the evidence for a node with a single variable at the specified time.Doubleget(Variable variable)Gets the hard evidence for a discrete variable or continuous variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.voidget(Variable variable, Double[] destination, int destinationStart, int startTime, int count)Gets the evidence for a temporal variable.Doubleget(Variable variable, Integer time)Gets the evidence for a discrete variable at the specified time.EvidenceTypegetEvidenceType(Node node)Returns the type of evidence currently set for a node with a single variable.EvidenceTypegetEvidenceType(Node node, Integer time)Returns the type of evidence currently set for a node with a single variable at a given time.EvidenceTypegetEvidenceType(Variable variable)Returns the type of evidence currently set for a variable (if any).EvidenceTypegetEvidenceType(Variable variable, Integer time)Returns the type of evidence currently set for a variable at a given time.EvidenceTypesgetEvidenceTypes(Node node)Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).EvidenceTypesgetEvidenceTypes(Node node, Integer time)Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).EvidenceTypesgetEvidenceTypes(Variable variable)Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).EvidenceTypesgetEvidenceTypes(Variable variable, Integer time)Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).doublegetLogWeight()Gets the natural logarithm ofEvidence.getWeight().IntegergetMaxTime()Gets the maximum time containing evidence.IntegergetMaxTime(Variable variable)Gets the maximum time containing evidence for a variable.NetworkgetNetwork()Gets the Bayesian network that is the the target of the evidence.IntegergetState(Node node)Gets the hard evidence state for node with a single variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.IntegergetState(Node node, Integer time)Gets the hard evidence state for node with a single variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.IntegergetState(Variable variable)Gets the hard evidence state for a particular variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.IntegergetState(Variable variable, Integer time)Gets the hard evidence state for a particular variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.voidgetStates(Node node, double[] buffer)Fills out a buffer containing the soft evidence for a node with a single variable.voidgetStates(Node node, double[] buffer, Integer time)Fills out a buffer containing the soft evidence for a node with a single variable at a specified time.voidgetStates(Table table)Fills out a table containing the soft evidence for a particular variable.voidgetStates(Variable variable, double[] buffer)Fills out a buffer containing the soft evidence for a particular variable.voidgetStates(Variable variable, double[] buffer, Integer time)Fills out a buffer containing the soft evidence for a particular variable at a specified time.voidgetVariables(Variable[] buffer)Fills out a buffer with all variables that have either hard or soft evidence.doublegetWeight()Gets a weight that can be applied to the evidence.voidload(InputStream input)Loads evidence from the specified stream.voidload(String fileName)Loads evidence from the specified file.voidloadFromString(String value)Loads evidence from a string using UTF-8 encoding.voidloadFromString(String value, String charSetName)Loads evidence from a string using the specified encoding.voidsave(OutputStream output)Saves the evidence to the specified stream.voidsave(String fileName)Saves the specified to the specified file.StringsaveToString()Saves evidence to a string, with UTF-8 encoding.StringsaveToString(String charSetName)Saves evidence to a string, with the specified encoding.voidset(Node node, Double value)Sets a node's variable to a particular value (hard evidence).voidset(Node node, Double[] source, int sourceStart, int startTime, int count)Sets temporal evidence on a node with a single variable.voidset(Node node, Double value, Integer time)Sets evidence on a node's single variable at a specified time.voidset(Variable variable, Double value)Sets a variable to a particular value (hard evidence).voidset(Variable variable, Double[] source, int sourceStart, int startTime, int count)Sets temporal evidence on a variable.voidset(Variable variable, Double value, Integer time)Sets evidence on a variable at a specified time.voidset(Variable variable, Double value, Integer time, InterventionType interventionType)Sets evidence on the variable, in the form of an intervention (do-operator).voidsetLogWeight(double value)Sets the natural logarithm ofEvidence.getWeight().voidsetState(Node node, Integer state)Sets evidence on a node with a single discrete variable to a particular state (hard evidence).voidsetState(Node node, Integer state, Integer time)Sets evidence on a node with a single discrete variable to a particular state (hard evidence) specifiying a time if the node is temporal.voidsetState(State state)Sets evidence on a discrete state (hard evidence).voidsetState(State state, Integer time)Sets evidence on a discrete state (hard evidence) at a particular time (zero based).voidsetState(State state, Integer time, InterventionType interventionType)Sets evidence on a discrete state (hard evidence), in the form of an intervention (do-operator).voidsetState(Variable variable, Integer state)Sets a discrete variable to a particular state (hard evidence).voidsetState(Variable variable, Integer state, Integer time)Sets a discrete variable to a particular state (hard evidence), specifiying a time if the state belongs to a variable whose node is temporal.voidsetStates(Node node, double[] values)Sets soft evidence for a discrete node with a single variable.voidsetStates(Node node, double[] values, Integer time)Sets soft evidence for a discrete node with a single variable, at a specified time.voidsetStates(Variable variable, double[] values)Sets soft evidence for a particular discrete variable.voidsetStates(Variable variable, double[] values, Integer time)Sets soft evidence for a particular discrete variable at a specified time.voidsetWeight(double value)Sets a weight that can be applied to the evidence.intsize()Gets the count of variables with either hard, soft or temporal evidence set.
-
-
-
Constructor Detail
-
DefaultEvidence
public DefaultEvidence(Network network)
Initializes a new instance of theDefaultEvidenceclass, with the target Bayesian network.- Parameters:
network- The targetNetwork.
-
DefaultEvidence
public DefaultEvidence(Evidence evidence)
Initializes a new instance of theDefaultEvidenceclass, and copies the evidence from another instance.- Parameters:
evidence- The evidence to copy.
-
DefaultEvidence
public DefaultEvidence(DefaultEvidence evidence)
Initializes a new instance of theDefaultEvidenceclass, copying data from an existingDefaultEvidenceobject.- Parameters:
evidence- The evidence.
-
-
Method Detail
-
size
public int size()
Gets the count of variables with either hard, soft or temporal evidence set.
-
getNetwork
public Network getNetwork()
Gets the Bayesian network that is the the target of the evidence.- Specified by:
getNetworkin interfaceEvidence- Returns:
- The
Network.
-
getWeight
public double getWeight()
Gets a weight that can be applied to the evidence. Default value is 1. Value must be positive. A weight can be applied to a case, to give it more or less importance during learning or inference. For example, if a database has groups of records that are identical, each group can be represented by a single case with a weight equal to the number in that group.Note that setting the weight to anything but 1, will effect the
QueryOutput.getLogLikelihood()statistic.
-
setWeight
public void setWeight(double value)
Sets a weight that can be applied to the evidence. Default value is 1. Value must be positive. A weight can be applied to a case, to give it more or less importance during learning or inference. For example, if a database has groups of records that are identical, each group can be represented by a single case with a weight equal to the number in that group.Note that setting the weight to anything but 1, will effect the
QueryOutput.getLogLikelihood()statistic.
-
getLogWeight
public double getLogWeight()
Gets the natural logarithm ofEvidence.getWeight().- Specified by:
getLogWeightin interfaceEvidence
-
setLogWeight
public void setLogWeight(double value)
Sets the natural logarithm ofEvidence.getWeight().- Specified by:
setLogWeightin interfaceEvidence
-
beginUpdate
public void beginUpdate()
Disables change notifications (if present), untilEvidence.endUpdate()is called. Calls toEvidence.beginUpdate()can be nested, in which case notifications only continue after the final call toEvidence.endUpdate().- Specified by:
beginUpdatein interfaceEvidence
-
clear
public void clear(Variable variable, Integer time)
Clears evidence on a variable at the specified time.
-
clear
public void clear(Variable variable)
Clears any evidence on a variable.
-
clear
public void clear(Node node)
Clears evidence on a node's variables.- Specified by:
clearin interfaceEvidence- Parameters:
node- The node whose variables you want to clear evidence on.- Throws:
NullPointerException- [node] is null.
-
clear
public void clear()
Clears any evidence on all variables.
-
copy
public void copy(Evidence evidence)
Replaces the current evidence, with that from anotherEvidenceinstance.
-
copy
public void copy(Evidence evidence, Variable variable)
Replaces the current evidence for an individual variable, with that from anotherEvidenceinstance. For temporal variables, evidence is copied from the source at all times.
-
copy
public void copy(Evidence evidence, Variable variable, Integer time)
Replaces the current evidence for an individual variable at a specific time, with that from anotherEvidenceinstance.
-
endUpdate
public void endUpdate()
Enables change notifications (if available). A corresponding call must first be made toEvidence.beginUpdate()to disable notifications.
-
get
public Double get(Variable variable)
Gets the hard evidence for a discrete variable or continuous variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.- Specified by:
getin interfaceEvidence- Parameters:
variable- The discrete or continuous variable.- Returns:
- The evidence for the variable, or null if the
EvidenceTypedoes not equalEvidenceType.HARD.
-
get
public Double get(Variable variable, Integer time)
Gets the evidence for a discrete variable at the specified time.
-
get
public Double get(Node node, Integer time)
Gets the evidence for a node with a single variable at the specified time.
-
get
public void get(Variable variable, Double[] destination, int destinationStart, int startTime, int count)
Gets the evidence for a temporal variable.- Specified by:
getin interfaceEvidence- Parameters:
variable- The temporal variable.destination- The destination buffer which will be filled with the evidence values.destinationStart- The position in the buffer to start copying.startTime- The time to start copying from.count- The number of evidence values to copy.
-
get
public void get(Node node, Double[] destination, int destinationStart, int startTime, int count)
Gets the evidence for a node's single temporal variable.- Specified by:
getin interfaceEvidence- Parameters:
node- A node with a single temporal variable.destination- The destination buffer which will be filled with the evidence values.destinationStart- The position in the buffer to start copying.startTime- The time to start copying from.count- The number of evidence values to copy.
-
get
public Double get(Node node)
Gets the hard evidence value for a particular node's variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.- Specified by:
getin interfaceEvidence- Parameters:
node- A node with a single variable in question.- Returns:
- The evidence value for the node's variable, or null if the
EvidenceTypedoes not equalEvidenceType.HARD.
-
getEvidenceType
public EvidenceType getEvidenceType(Variable variable)
Returns the type of evidence currently set for a variable (if any).- Specified by:
getEvidenceTypein interfaceEvidence- Parameters:
variable- The variable in question.- Returns:
- The
EvidenceType.
-
getEvidenceType
public EvidenceType getEvidenceType(Node node)
Returns the type of evidence currently set for a node with a single variable.- Specified by:
getEvidenceTypein interfaceEvidence- Parameters:
node- The node in question.- Returns:
- The
EvidenceType.
-
getEvidenceType
public EvidenceType getEvidenceType(Node node, Integer time)
Returns the type of evidence currently set for a node with a single variable at a given time.- Specified by:
getEvidenceTypein interfaceEvidence- Parameters:
node- The node in question.time- The time at which evidence is set. Can be null.- Returns:
- The
EvidenceType.
-
getEvidenceType
public EvidenceType getEvidenceType(Variable variable, Integer time)
Returns the type of evidence currently set for a variable at a given time.- Specified by:
getEvidenceTypein interfaceEvidence- Parameters:
variable- The variable in question.time- The time at which evidence is set. Can be null.- Returns:
- The
EvidenceType.
-
getEvidenceTypes
public EvidenceTypes getEvidenceTypes(Variable variable)
Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).- Specified by:
getEvidenceTypesin interfaceEvidence- Parameters:
variable- The variable in question.- Returns:
- The
EvidenceTypes.
-
getEvidenceTypes
public EvidenceTypes getEvidenceTypes(Node node)
Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).- Specified by:
getEvidenceTypesin interfaceEvidence- Parameters:
node- The node in question.- Returns:
- The
EvidenceTypes.
-
getEvidenceTypes
public EvidenceTypes getEvidenceTypes(Node node, Integer time)
Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).- Specified by:
getEvidenceTypesin interfaceEvidence- Parameters:
node- The node in question.time- The time at which evidence is set. Can be null.- Returns:
- The
EvidenceTypes.
-
getEvidenceTypes
public EvidenceTypes getEvidenceTypes(Variable variable, Integer time)
Gets the type of evidence (if any) and whether or not it is an intervention (do-operator).- Specified by:
getEvidenceTypesin interfaceEvidence- Parameters:
variable- The variable in question.time- The time at which evidence is set. Can be null.- Returns:
- The
EvidenceTypes.
-
getMaxTime
public Integer getMaxTime(Variable variable)
Gets the maximum time containing evidence for a variable.- Specified by:
getMaxTimein interfaceEvidence- Parameters:
variable- The variable to check.- Returns:
- The maximum zero based time at which evidence is present for the variable or null if no evidence is present.
-
getMaxTime
public Integer getMaxTime()
Gets the maximum time containing evidence.- Specified by:
getMaxTimein interfaceEvidence- Returns:
- The maximum zero based time at which evidence is present for any variable or null if no evidence is present.
-
getState
public Integer getState(Variable variable)
Gets the hard evidence state for a particular variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.- Specified by:
getStatein interfaceEvidence- Parameters:
variable- The variable.- Returns:
- The zero based index of the
Statewith hard evidence set, or null if theEvidenceTypedoes not equalEvidenceType.HARD..
-
getState
public Integer getState(Variable variable, Integer time)
Gets the hard evidence state for a particular variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.- Specified by:
getStatein interfaceEvidence- Parameters:
variable- The variable.time- Time at which to retrieve evidence, if the variable belongs to a temporal node, otherwise null.- Returns:
- The zero based index of the
Statewith hard evidence set, or null if theEvidenceTypedoes not equalEvidenceType.HARD..
-
getState
public Integer getState(Node node)
Gets the hard evidence state for node with a single variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.- Specified by:
getStatein interfaceEvidence- Parameters:
node- The node with a single discrete variable.- Returns:
- The zero based index of the
Statewith hard evidence set, or null if theEvidenceTypedoes not equalEvidenceType.HARD..
-
getState
public Integer getState(Node node, Integer time)
Gets the hard evidence state for node with a single variable, or returns null if theEvidenceTypeequalsEvidenceType.NONEorEvidenceType.SOFT.- Specified by:
getStatein interfaceEvidence- Parameters:
node- The node with a single discrete variable.time- Time at which to retrieve evidence, if the node is temporal, otherwise null.- Returns:
- The zero based index of the
Statewith hard evidence set, or null if theEvidenceTypedoes not equalEvidenceType.HARD..
-
getStates
public void getStates(Variable variable, double[] buffer)
Fills out a buffer containing the soft evidence for a particular variable. If the variable does not have soft evidence, the method will succeed, however it is better to use another version ofGet. The resulting values will depend on the currentEvidenceTypefor the variable:EvidenceType.NONE- All values will equal 1.EvidenceType.HARD- All values will equal 0, except at the hard evidence state, where the value will equal 1.EvidenceType.NONE- The soft evidence values will be used.
-
getStates
public void getStates(Node node, double[] buffer)
Fills out a buffer containing the soft evidence for a node with a single variable. If the variable does not have soft evidence, the method will succeed, however it is better to use another version ofGet. The resulting values will depend on the currentEvidenceTypefor the variable:EvidenceType.NONE- All values will equal 1.EvidenceType.HARD- All values will equal 0, except at the hard evidence state, where the value will equal 1.EvidenceType.NONE- The soft evidence values will be used.
-
getStates
public void getStates(Table table)
Fills out a table containing the soft evidence for a particular variable. If the variable does not have soft evidence, the method will succeed, however it is better to use another version ofGet. The resulting values will depend on the currentEvidenceTypefor the variable:EvidenceType.NONE- All values will equal 1.EvidenceType.HARD- All values will equal 0, except at the hard evidence state, where the value will equal 1.EvidenceType.NONE- The soft evidence values will be used.
-
getStates
public void getStates(Node node, double[] buffer, Integer time)
Fills out a buffer containing the soft evidence for a node with a single variable at a specified time. If the variable does not have soft evidence, the method will succeed, however it is better to use another version ofGet. The resulting values will depend on the currentEvidenceTypefor the variable:EvidenceType.NONE- All values will equal 1.EvidenceType.HARD- All values will equal 0, except at the hard evidence state, where the value will equal 1.EvidenceType.NONE- The soft evidence values will be used.
-
getStates
public void getStates(Variable variable, double[] buffer, Integer time)
Fills out a buffer containing the soft evidence for a particular variable at a specified time. If the variable does not have soft evidence, the method will succeed, however it is better to use another version ofGet. The resulting values will depend on the currentEvidenceTypefor the variable:EvidenceType.NONE- All values will equal 1.EvidenceType.HARD- All values will equal 0, except at the hard evidence state, where the value will equal 1.EvidenceType.NONE- The soft evidence values will be used.
-
getVariables
public void getVariables(Variable[] buffer)
Fills out a buffer with all variables that have either hard or soft evidence. The buffer must have length equal to or greater than the currentEvidence.size().- Specified by:
getVariablesin interfaceEvidence- Parameters:
buffer- A container for any variables with evidence. It must have length equal to or greater than the currentEvidence.size().
-
load
public void load(InputStream input) throws XMLStreamException
Loads evidence from the specified stream.- Specified by:
loadin interfaceEvidence- Parameters:
input- The input stream.- Throws:
XMLStreamException
-
load
public void load(String fileName) throws IOException, XMLStreamException
Loads evidence from the specified file.- Specified by:
loadin interfaceEvidence- Parameters:
fileName- Name of the file.- Throws:
IOExceptionXMLStreamException
-
save
public void save(OutputStream output) throws XMLStreamException
Saves the evidence to the specified stream.- Specified by:
savein interfaceEvidence- Parameters:
output- The output stream.- Throws:
XMLStreamException
-
save
public void save(String fileName) throws IOException, XMLStreamException
Saves the specified to the specified file.- Specified by:
savein interfaceEvidence- Parameters:
fileName- Name of the file.- Throws:
IOExceptionXMLStreamException
-
saveToString
public String saveToString(String charSetName) throws XMLStreamException
Saves evidence to a string, with the specified encoding.- Specified by:
saveToStringin interfaceEvidence- Parameters:
charSetName- The encoding to use.- Returns:
- The evidence persisted to a string.
- Throws:
XMLStreamException
-
saveToString
public String saveToString() throws XMLStreamException
Saves evidence to a string, with UTF-8 encoding.- Specified by:
saveToStringin interfaceEvidence- Returns:
- The evidence persisted to a string.
- Throws:
XMLStreamException
-
loadFromString
public void loadFromString(String value, String charSetName) throws UnsupportedEncodingException, XMLStreamException
Loads evidence from a string using the specified encoding.- Specified by:
loadFromStringin interfaceEvidence- Parameters:
value- The persisted string value of the evidence.charSetName- The encoding the evidence was originally saved in.- Throws:
UnsupportedEncodingExceptionXMLStreamException
-
loadFromString
public void loadFromString(String value) throws UnsupportedEncodingException, XMLStreamException
Loads evidence from a string using UTF-8 encoding.- Specified by:
loadFromStringin interfaceEvidence- Parameters:
value- The persisted string value of the evidemce.- Throws:
UnsupportedEncodingExceptionXMLStreamException
-
set
public void set(Variable variable, Double[] source, int sourceStart, int startTime, int count)
Sets temporal evidence on a variable.
-
set
public void set(Node node, Double[] source, int sourceStart, int startTime, int count)
Sets temporal evidence on a node with a single variable.
-
set
public void set(Variable variable, Double value)
Sets a variable to a particular value (hard evidence).
-
set
public void set(Node node, Double value, Integer time)
Sets evidence on a node's single variable at a specified time.
-
set
public void set(Variable variable, Double value, Integer time)
Sets evidence on a variable at a specified time.
-
set
public void set(Variable variable, Double value, Integer time, InterventionType interventionType)
Sets evidence on the variable, in the form of an intervention (do-operator).- Specified by:
setin interfaceEvidence- Parameters:
variable- The variable to set evidence on.value- The value to set, or null to clear the evidence.time- The time at which to set evidence, if the node is temporal, otherwise null.interventionType- Whether or not the evidence is an intervention.
-
set
public void set(Node node, Double value)
Sets a node's variable to a particular value (hard evidence).
-
setState
public void setState(Variable variable, Integer state)
Sets a discrete variable to a particular state (hard evidence).
-
setState
public void setState(Variable variable, Integer state, Integer time)
Sets a discrete variable to a particular state (hard evidence), specifiying a time if the state belongs to a variable whose node is temporal.- Specified by:
setStatein interfaceEvidence- Parameters:
variable- The discrete variable to set evidence on.state- The zero based index of the state to set, or null to clear the evidence.time- The time at which to set evidence, if the state belongs to a variable whose node is temporal, otherwise null.
-
setState
public void setState(State state)
Sets evidence on a discrete state (hard evidence).
-
setState
public void setState(State state, Integer time, InterventionType interventionType)
Sets evidence on a discrete state (hard evidence), in the form of an intervention (do-operator).
-
setState
public void setState(State state, Integer time)
Sets evidence on a discrete state (hard evidence) at a particular time (zero based).
-
setState
public void setState(Node node, Integer state)
Sets evidence on a node with a single discrete variable to a particular state (hard evidence).
-
setState
public void setState(Node node, Integer state, Integer time)
Sets evidence on a node with a single discrete variable to a particular state (hard evidence) specifiying a time if the node is temporal.
-
setStates
public void setStates(Variable variable, double[] values)
Sets soft evidence for a particular discrete variable. If the evidence [values] are not actual soft evidence (e.g. {1, 0, 0} or {1, 1, 1} then the evidence will be stored correctly but theEvidenceTypewill not beEvidenceType.SOFT.
-
setStates
public void setStates(Node node, double[] values)
Sets soft evidence for a discrete node with a single variable. If the evidence [values] are not actual soft evidence (e.g. {1, 0, 0} or {1, 1, 1} then the evidence will be stored correctly but theEvidenceTypewill not beEvidenceType.SOFT.
-
setStates
public void setStates(Node node, double[] values, Integer time)
Sets soft evidence for a discrete node with a single variable, at a specified time. If the evidence [values] are not actual soft evidence (e.g. {1, 0, 0} or {1, 1, 1} then the evidence will be stored correctly but theEvidenceTypewill not beEvidenceType.SOFT.
-
setStates
public void setStates(Variable variable, double[] values, Integer time)
Sets soft evidence for a particular discrete variable at a specified time. If the evidence [values] are not actual soft evidence (e.g. {1, 0, 0} or {1, 1, 1} then the evidence will be stored correctly but theEvidenceTypewill not beEvidenceType.SOFT.
-
-