当前位置: 首页>>代码示例>>Java>>正文


Java UnknowkNodeStateException类代码示例

本文整理汇总了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);
}
 
开发者ID:gsi-upm,项目名称:Shanks,代码行数:30,代码来源:ShanksAgentBayesianReasoningCapability.java

示例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);
}
 
开发者ID:gsi-upm,项目名称:Shanks,代码行数:22,代码来源:ShanksAgentBayesianReasoningCapability.java

示例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);
}
 
开发者ID:gsi-upm,项目名称:Shanks,代码行数:23,代码来源:ShanksAgentBayesianReasoningCapability.java


注:本文中的es.upm.dit.gsi.shanks.agent.capability.reasoning.bayes.exception.UnknowkNodeStateException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。