Package unbbayes.prs.mebn.entity

Examples of unbbayes.prs.mebn.entity.StateLink


   
    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);
View Full Code Here


  /* (non-Javadoc)
   * @see unbbayes.prs.mebn.ResidentNode#addPossibleValueLink(unbbayes.prs.mebn.entity.Entity)
   */
  public StateLink addPossibleValueLink(Entity possibleValue) {
    StateLink foundObj = this.getStateLinkByEntity(possibleValue);
    // avoid duplicate
    if (foundObj == null) {
      return super.addPossibleValueLink(possibleValue);
    }
    return foundObj;
View Full Code Here

          for (Object instance : instances) {
            individualTwo = (RDFIndividual) instance;
            String stateName = individualTwo.getBrowserText();
            /* case 1: booleans states */
            if (stateName.equals("true")) {
              StateLink link = domainResidentNode
                  .addPossibleValueLink(getMebn()
                      .getBooleanStatesEntityContainer()
                      .getTrueStateEntity());
              List<String> globallyObjects = getMapBooleanStateGloballyObjects()
                  .get("true");
              if (globallyObjects.contains(domainResidentNode
                  .getName())) {
                link.setGloballyExclusive(true);
              } else {
                link.setGloballyExclusive(false);
              }
              domainResidentNode
                  .setTypeOfStates(IResidentNode.BOOLEAN_RV_STATES);
            } else {
              if (stateName.equals("false")) {
                StateLink link = domainResidentNode
                    .addPossibleValueLink(getMebn()
                        .getBooleanStatesEntityContainer()
                        .getFalseStateEntity());
                List<String> globallyObjects = getMapBooleanStateGloballyObjects()
                    .get("false");
                if (globallyObjects.contains(domainResidentNode
                    .getName())) {
                  link.setGloballyExclusive(true);
                } else {
                  link.setGloballyExclusive(false);
                }
                domainResidentNode
                    .setTypeOfStates(IResidentNode.BOOLEAN_RV_STATES);
              } else {
                if (stateName.equals("absurd")) {
                  StateLink link = domainResidentNode
                      .addPossibleValueLink(getMebn()
                          .getBooleanStatesEntityContainer()
                          .getAbsurdStateEntity());
                  List<String> globallyObjects = getMapBooleanStateGloballyObjects()
                      .get("absurd");
                  if (globallyObjects.contains(domainResidentNode
                      .getName())) {
                    link.setGloballyExclusive(true);
                  } else {
                    link.setGloballyExclusive(false);
                  }
                  domainResidentNode
                      .setTypeOfStates(IResidentNode.BOOLEAN_RV_STATES);
                } else {
                  if (getMapTypes().get(stateName) != null) {

                    /* case 2:object entities */

                    StateLink link = domainResidentNode
                        .addPossibleValueLink(getMapTypes()
                            .get(stateName));
                    domainResidentNode
                        .setTypeOfStates(IResidentNode.OBJECT_ENTITY);

                  } else {
                    /* case 3: categorical states */
                    try {
                      state = getMebn()
                          .getCategoricalStatesEntityContainer()
                          .getCategoricalState(
                              individualTwo
                                  .getBrowserText());
                      StateLink link = domainResidentNode
                          .addPossibleValueLink(state);

                      List<String> globallyObjects = getMapCategoricalStateGloballyObjects()
                          .get(state.getName());
                      if (globallyObjects
                          .contains(domainResidentNode
                              .getName())) {
                        link.setGloballyExclusive(true);
                      } else {
                        link.setGloballyExclusive(false);
                      }
                      domainResidentNode
                          .setTypeOfStates(IResidentNode.CATEGORY_RV_STATES);
                    } catch (CategoricalStateDoesNotExistException e) {
                      // TODO Auto-generated catch block
View Full Code Here

                    resource.getString("confirmation"),
                    JOptionPane.YES_NO_OPTION);
                if (answer == JOptionPane.YES_OPTION) {
                  mebnController
                  .removeAllPossibleValues(residentNode);
                  StateLink stateLink;
                  try {
                    stateLink = mebnController.addPossibleValue(residentNode,
                        nameValue);

                    stateLink.setGloballyExclusive(checkGloballyExclusive.isSelected());
                    residentNode
                    .setTypeOfStates(IResidentNode.CATEGORY_RV_STATES);
                   
                  } catch (DuplicatedNameException e) {
                        JOptionPane.showMessageDialog(mebnController.getScreen(),
                            resource.getString("nameException"),
                            resource.getString("nameDuplicated"),
                            JOptionPane.ERROR_MESSAGE);
                  } catch (ReservedWordException e2) {
                        JOptionPane.showMessageDialog(mebnController.getScreen(),
                            resource.getString("nameException"),
                            resource.getString("nameReserved"),
                            JOptionPane.ERROR_MESSAGE);
                  }
                }
              } else {
                StateLink stateLink;
                try {
                  stateLink = mebnController.addPossibleValue(residentNode, nameValue);
                  stateLink.setGloballyExclusive(checkGloballyExclusive.isSelected());
                } catch (DuplicatedNameException e) {
                      JOptionPane.showMessageDialog(mebnController.getScreen(),
                          resource.getString("nameException"),
                          resource.getString("nameDuplicated"),
                          JOptionPane.ERROR_MESSAGE);
View Full Code Here

                  resource.getString("confirmation"),
                  JOptionPane.YES_NO_OPTION);
              if (answer == JOptionPane.YES_OPTION) {
                residentNode.removeAllPossibleValues();
               
                StateLink link = mebnController.addObjectEntityAsPossibleValue(residentNode, (ObjectEntity)comboEntities.getSelectedItem());
                mebnController.setGloballyExclusiveProperty(link, checkGloballyExclusive.isSelected());
               
                residentNode.setTypeOfStates(IResidentNode.OBJECT_ENTITY);
                listStatesPanel.update();
              }
            } else {
              StateLink link = mebnController.addObjectEntityAsPossibleValue(residentNode, (ObjectEntity)comboEntities.getSelectedItem());
              mebnController.setGloballyExclusiveProperty(link, checkGloballyExclusive.isSelected());
             
              residentNode
                  .setTypeOfStates(IResidentNode.OBJECT_ENTITY);
              listStatesPanel.update();
View Full Code Here

      });

    }
   
    public void selectState(StateLink entity) {
      StateLink selectEntity = entity;
      if (entity != null) {
        checkGloballyExclusive.setSelected(entity.isGloballyExclusive());
      } else {
        checkGloballyExclusive.setSelected(false);
      }
View Full Code Here

TOP

Related Classes of unbbayes.prs.mebn.entity.StateLink

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.