本文整理汇总了Java中es.upm.dit.gsi.shanks.agent.capability.reasoning.bayes.exception.UnknowkNodeStateException类的典型用法代码示例。如果您正苦于以下问题:Java UnknowkNodeStateException类的具体用法?Java UnknowkNodeStateException怎么用?Java UnknowkNodeStateException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnknowkNodeStateException类属于es.upm.dit.gsi.shanks.agent.capability.reasoning.bayes.exception包,在下文中一共展示了UnknowkNodeStateException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEvidence
import es.upm.dit.gsi.shanks.agent.capability.reasoning.bayes.exception.UnknowkNodeStateException; //导入依赖的package包/类
/**
* Add information to the Bayesian network to reason with it.
*
* @param bn
* @param nodeName
* @param status
* @throws Exception
*/
public static void addEvidence(ProbabilisticNetwork bn, String nodeName,
String status) throws ShanksException {
ProbabilisticNode node = ShanksAgentBayesianReasoningCapability
.getNode(bn, nodeName);
if (node.hasEvidence()) {
ShanksAgentBayesianReasoningCapability.clearEvidence(bn, node);
}
int states = node.getStatesSize();
for (int i = 0; i < states; i++) {
if (status.equals(node.getStateAt(i))) {
node.addFinding(i);
try {
bn.updateEvidences();
} catch (Exception e) {
throw new ShanksException(e);
}
return;
}
}
throw new UnknowkNodeStateException(bn, nodeName, status);
}
示例2: getHypothesis
import es.upm.dit.gsi.shanks.agent.capability.reasoning.bayes.exception.UnknowkNodeStateException; //导入依赖的package包/类
/**
* Get the value of a status in a node
*
* @param bn
* @param nodeName
* @param status
* @return a float with the probability
* @throws UnknownNodeException
* @throws UnknowkNodeStateException
*/
public static float getHypothesis(Network bn, String nodeName, String status)
throws ShanksException {
int node = ShanksAgentBayesianReasoningCapability.getNode(bn, nodeName);
String[] states = bn.getOutcomeIds(node);
for (int i = 0; i < states.length; i++) {
if (status.equals(states[i])) {
return (float) bn.getNodeValue(node)[i];
}
}
throw new UnknowkNodeStateException(bn, nodeName, status);
}
示例3: getHypothesis
import es.upm.dit.gsi.shanks.agent.capability.reasoning.bayes.exception.UnknowkNodeStateException; //导入依赖的package包/类
/**
* Get the value of a status in a node
*
* @param bn
* @param nodeName
* @param status
* @return a float with the probability
* @throws UnknownNodeException
* @throws UnknowkNodeStateException
*/
public static float getHypothesis(ProbabilisticNetwork bn, String nodeName,
String status) throws ShanksException {
ProbabilisticNode node = ShanksAgentBayesianReasoningCapability
.getNode(bn, nodeName);
int states = node.getStatesSize();
for (int i = 0; i < states; i++) {
if (status.equals(node.getStateAt(i))) {
return node.getMarginalAt(i);
}
}
throw new UnknowkNodeStateException(bn, nodeName, status);
}