code: public static void addSoftEvidence(Network bn, String nodeName,
              HashMap<String, Double> softEvidence) throws ShanksException {
          String auxNodeName = softEvidenceNodePrefix + nodeName;
          int targetNode = bn.getNode(nodeName);
          boolean found = false;
          int[] children = bn.getChildren(targetNode);
          for (int child : children) {
              if (bn.getNodeName(child).equals(auxNodeName)) {
                  if (bn.getOutcomeCount(child) == 2
                          && bn.getOutcomeId(child, 0).equals(triggerState)) {
                      found = true;
                      break;
                  }
              }
          }
          if (!found) {
              // Create soft-evidence node
              bn.addNode(NodeType.Cpt, auxNodeName);
              bn.setNodeName(auxNodeName, auxNodeName);
              int node = bn.getNode(auxNodeName);
              bn.setOutcomeId(node, 0, triggerState);
              bn.setOutcomeId(node, 1, "NON" + triggerState);
              // bn.insertOutcome(auxNode, 0, triggerState);
              // bn.insertOutcome(auxNode, 1, "NON" + triggerState);
              double[] cpt = bn.getNodeDefinition(auxNodeName);
              for (int i = 0; i < cpt.length; i++) {
                  cpt[i] = (float) 0.5;
              }
  
              bn.addArc(targetNode, bn.getNode(auxNodeName));
              cpt = bn.getNodeDefinition(auxNodeName);
              for (int i = 0; i < cpt.length; i++) {
                  cpt[i] = (float) 0.5;
              }
          }
          ShanksAgentBayesianReasoningCapability
                  .updateSoftEvidenceAuxiliaryNodeCPT(bn, nodeName, softEvidence);
          ShanksAgentBayesianReasoningCapability.addEvidence(bn,
                  softEvidenceNodePrefix + nodeName, triggerState);
  
      }
docs: Add soft-evidence to the Bayesian network to reason with it.
  
  @param bn
  @param nodeName
  @param softEvidence
  @throws ShanksException