Package unbbayes.prs.mebn

Examples of unbbayes.prs.mebn.IResidentNode


   
    node.setMFragInstance(mFragInstance);
   
    //--- 1) Evaluate if the node is a finding.
   
    IResidentNode resident = node.getResidentNode();
   
    List<OVInstance> argumentList = new ArrayList<OVInstance>();
   
    for(int i = 0; i < node.getOvArray().length; i++){
      argumentList.add(OVInstance.getInstance(node.getOvArray()[i], node.getEntityArray()[i]));
    }
   
    StateLink exactValue = kb.searchFinding(
        node.getResidentNode(), argumentList);
   
    /*
     * Nota: como o algoritmo apenas sobe, é necessário continuar a avaliação
     * acima mesmo quando o nó for setado como um finding, pois acima dele pode
     * ter uma query ou nó que influência a query. (Caso fosse feita a avaliação
     * acima e abaixo, não seria necessária esta subida, mas o algoritmo seria
     * mais complexo). Isto gerará um monte de nós candidados a serem excluidos
     * no próximo passo. 
     */
    if(exactValue!= null){
      //The node is a finding...
      node.setState(exactValue.getState());
      ssbn.addFindingToTheFindingList(node);
     
      if (logManager != null) {
        logManager.printText(level4, false, " -> Node " + node +
          " set as a finding. Exact Value = " + exactValue);
      }
    }
   
   
    //---- 2) Create the parents of node from the resident nodes
   
    //If the context node of the MFrag don't are evaluated, the creation of
    //the parents isn't possible
    if(mFragInstance.isUseDefaultDistribution()){
     
      if (logManager != null) {
        logManager.printText(level4, false, " -> Node can't be evaluated: mfrag using default distribution");
      }
      return;
   
    }
   
    OrdinaryVariable[] ovFilledArray = node.getOvArray();
    LiteralEntityInstance[] entityFilledArray = node.getEntityArray();
 
    if (logManager != null) {
      logManager.printText(level4, false, " 1) Evaluate the resident node parents");
    }
    for(ResidentNode residentNodeParent: resident.getResidentNodeFatherList()){
     
      List<SimpleSSBNNode> createdNodesList = createParents(node,
          ovFilledArray, entityFilledArray, residentNodeParent);
     
      if (logManager != null) {
        logManager.printText(level4, false, "Resident parents generates from the resident node " +
          residentNodeParent);
      }
      int count = 0;
      for(SimpleSSBNNode newNode: createdNodesList){
        if (logManager != null) {
          logManager.printText(level4, false, "Evaluate " + count + " - "+ newNode);
        }
        count= count + 1 ;
        evaluateNodeInMFragInstance(mFragInstance, newNode);
      }
     
    }
   
    //---- 3) Create the parents of node from the input nodes
    if (logManager != null) {
      logManager.printText(level4, false, " 2) Evaluate the input node parents");
    }
    for(InputNode inputNodeParent: resident.getParentInputNodesList()){
     
      if(inputNodeParent.getResidentNodePointer().getResidentNode().equals(resident)){
        //Special case: the recursivity.
        if (logManager != null) {
          logManager.printText(level4, false, " Recursivity treatment: " + resident);
View Full Code Here


    statesFatherList = new ArrayList<String>();
    argumentsList = new ArrayList<String>();
   
    for(ResidentNode resident : residentNode.getResidentNodeFatherList()){
      fatherList.add(resident.getName());
      IResidentNode domainResidentNode = resident;
     
      for(StateLink state: domainResidentNode.getPossibleValueLinkList()){
        statesFatherList.add(state.getState().getName());
      }
    }
   
    for(InputNode input : residentNode.getParentInputNodesList()){
View Full Code Here

          }
          else{
            if ((e.getModifiers() == MouseEvent.BUTTON1_MASK) && (e.getClickCount() == 1)){
              jlArguments.setEnabled(true);
              int selectedIndex = jlFathers.getSelectedIndex();
              IResidentNode residentNode = residentNodeAuxList.get(selectedIndex);
              updateStatesList(residentNode);
             
              IMultiEntityNode node = fatherNodeList.get(selectedIndex);
                // let's assume node != null.
              if(node instanceof InputNode){
View Full Code Here

TOP

Related Classes of unbbayes.prs.mebn.IResidentNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.