code: public static void addSoftEvidence(ProbabilisticNetwork bn,
              String nodeName, HashMap<String, Double> softEvidence)
              throws ShanksException {
          ProbabilisticNode targetNode = ShanksAgentBayesianReasoningCapability
                  .getNode(bn, nodeName);
          boolean found = false;
          for (Node child : targetNode.getChildren()) {
              if (child.getName().equals(softEvidenceNodePrefix + nodeName)) {
                  if (child.getStatesSize() == 2
                          && child.getStateAt(0).equals(triggerState)) {
                      found = true;
                      break;
                  }
              }
          }
          if (!found) {
              // Create soft-evidence node
              ProbabilisticNode auxNode = new ProbabilisticNode();
              auxNode.setName(softEvidenceNodePrefix + nodeName);
              auxNode.setLabel(softEvidenceNodePrefix + nodeName);
              auxNode.appendState(triggerState);
              auxNode.appendState("NON" + triggerState);
              PotentialTable cpt = auxNode.getProbabilityFunction();
              cpt.addVariable(auxNode);
              for (int i = 0; i < cpt.tableSize(); i++) {
                  cpt.setValue(i, (float) 0.5);
              }
              auxNode.initMarginalList();
              bn.addNode(auxNode);
  
              Edge edge = new Edge(targetNode, auxNode);
              try {
                  bn.addEdge(edge);
                  cpt = auxNode.getProbabilityFunction();
                  for (int i = 0; i < cpt.tableSize(); i++) {
                      cpt.setValue(i, (float) 0.5);
                  }
                  auxNode.initMarginalList();
              } catch (Exception e) {
                  throw new ShanksException(e);
              }
          }
          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