Add information to the Bayesian network to reason with it.

@param bn
@param nodeName
@param status
@throws ShanksException
764862
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);
    }
797204
public boolean addToCorruptReplicasMap(Block blk, DatanodeDescriptor dn) {
    Collection<DatanodeDescriptor> nodes = getNodes(blk);
    if (nodes == null) {
      nodes = new TreeSet<DatanodeDescriptor>();
      corruptReplicasMap.put(blk, nodes);
    }
    boolean added = false;
    if (!nodes.contains(dn)) {
      added = nodes.add(dn);
      NameNode.stateChangeLog.info("BLOCK NameSystem.addToCorruptReplicasMap: "+
                                   blk.getBlockName() +
                                   " added as corrupt on " + dn.getName() +
                                   " by " + Server.getRemoteIp());
    } else {
      NameNode.stateChangeLog.info("BLOCK NameSystem.addToCorruptReplicasMap: "+
                                   "duplicate requested for " + 
                                   blk.getBlockName() + " to add as corrupt " +
                                   "on " + dn.getName() +
                                   " by " + Server.getRemoteIp());
    }
    return added;
  }
984354
@Override
	public void setModelInfo(int inputModelNumber,
			int chainCount) {
		modelNumber = inputModelNumber;
		structure.addModel(new ArrayList<Chain>(chainCount));
		chainMap.add(new HashMap<>());
	}
1021839
public static void clearEvidences(Network bn) throws ShanksException {
        try {
            bn.clearAllEvidence();
            bn.updateBeliefs();
        } catch (Exception e) {
            throw new ShanksException(e);
        }
    }
1199888
@Override
	public void updateStatistics(Instance inst) {
		// Update the statistics for this node
		// number of instances passing through the node
		nodeStatistics.addToValue(0, 1);
		// sum of y values
		nodeStatistics.addToValue(1, inst.classValue());
		// sum of squared y values
		nodeStatistics.addToValue(2, inst.classValue()*inst.classValue());
				
		this.perceptron.trainOnInstance(inst);
		if (this.predictionFunction != 1) { //Train target mean if prediction function is not Perceptron
			this.targetMean.trainOnInstance(inst);
		}
	}
965459
def add_node(self, node):
        """"""
        other_nodes = [n for n in self.nodes() if n.id != node.id]

        if isinstance(node, Source) and other_nodes:
            raise(Exception("Chain network already has a nodes, "
                            "can't add a source."))

        if other_nodes:
            parent = max(other_nodes, key=attrgetter('creation_time'))
            parent.connect(whom=node)
1262069
private boolean nodeHasAttribute(Node node, String attributeName) {
        return node.hasAttributes() && node.getAttributes().getNamedItem(attributeName) != null;
    }
1119309
private boolean isAttributeAxis(SimpleNode node) {
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
            if (((SimpleNode) node.jjtGetChild(i)).getId() == JJTAT) {
                return true;
            }
        }
        return false;
    }
1265378
public static int getNode(BayesianReasonerShanksAgent agent, String nodeName)
            throws ShanksException {
        return ShanksAgentBayesianReasoningCapability.getNode(
                agent.getBayesianNetwork(), nodeName);
    }
92052
public void addEdge(N a, N b)
    {
        if( !containsBoth(a, b) )
            return;//Cant add nodes to things that doing exist
        nodes.get(a).getOutgoing().add(b);
        nodes.get(b).getIncoming().add(a);
    }
1374442
public static void addEvidences(ProbabilisticNetwork bn,
            Map<String, String> evidences) throws ShanksException {
        for (Entry<String, String> evidence : evidences.entrySet()) {
            ShanksAgentBayesianReasoningCapability.addEvidence(bn,
                    evidence.getKey(), evidence.getValue());
        }
    }
392189
def set_node_status(node_id, status, **kwargs):
    
    user_id = kwargs.get('user_id')
    try:
        node_i = db.DBSession.query(Node).filter(Node.id == node_id).one()
    except NoResultFound:
        raise ResourceNotFoundError("Node %s not found"%(node_id))

    node_i.network.check_write_permission(user_id)

    node_i.status = status

    for link in node_i.links_to:
        link.status = status
    for link in node_i.links_from:
        link.status = status

    db.DBSession.flush()

    return node_i
128353
@SuppressWarnings("ObjectAllocationInLoop")
    public void add(NodeBase source, NodeBase dest) {
        // amount of commutative nodes
        int n = 0;
        for (NodeBase node : source.getDescendants()) {
            if (node instanceof CommutativeOperator) {
                n++;
            }
        }
        for (int i = 0; i < 1 << n; i++) {
            Root root = new Root(source.getClone());
            int j = 0;
            for (NodeBase node : root.getDescendants()) {
                if (node instanceof CommutativeOperator) {
                    if ((i & 1 << j) != 0) {
                        ((CommutativeOperator) node).flipChildren();
                    }
                    j++;
                }
            }
            rules.add(new OptimizationRule(root.getChild(), dest));
        }
    }
53162
private void updateMax(MtasRBTreeNode n, MtasRBTreeNode c) {
    if (c != null) {
      if (n.max < c.max) {
        n.max = c.max;
      }
    }
  }
71353
protected void addNode(ClusterNode node,
                         Map<ResourceType, String> resourceInfos) {
    synchronized (node) {
      // 1: primary
      nameToNode.put(node.getName(), node);
      faultManager.addNode(node.getName(), resourceInfos.keySet());
      nameToApps.put(node.getName(), resourceInfos);
      hostsToSessions.put(node, new HashSet<String>());
      clusterManager.getMetrics().restartTaskTracker(1);
      setAliveDeadMetrics();

      // 2: update runnable indices
      for (Map.Entry<ResourceType, RunnableIndices> entry :
          typeToIndices.entrySet()) {
        ResourceType type = entry.getKey();
        if (resourceInfos.containsKey(type)) {
          if (node.checkForGrant(Utilities.getUnitResourceRequest(type),
                                 resourceLimit)) {
            RunnableIndices r = entry.getValue();
            r.addRunnable(node);
          }
        }
      }
    }
  }
480286
public void add(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNext( node );
            node.setPrevious( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
245039
public void show(ManagementModelNode node, int x, int y) {
        removeAll();
        addExploreOption(node);

        String addressPath = node.addressPath();
        try {
            ModelNode  opNames = executor.doCommand(addressPath + ":read-operation-names");
            if (opNames.get("outcome").asString().equals("failed")) return;

            for (ModelNode name : opNames.get("result").asList()) {
                String strName = name.asString();

                // filter operations
                if (node.isGeneric() && !genericOpList.contains(strName)) continue;
                if (node.isLeaf() && !leafOpList.contains(strName)) continue;
                if (!node.isGeneric() && !node.isLeaf() && strName.equals("add")) continue;

                ModelNode opDescription = getResourceDescription(addressPath, strName);
                add(new OperationAction(node, strName, opDescription));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        super.show(invoker, x, y);
    }