Package unbbayes.prs.mebn

Examples of unbbayes.prs.mebn.ResidentNode


   * @return the query
   * @throws Exception the exception
   */
  private Query setupQuery(ShipEntity ship) throws Exception {
    Debug.setDebug(false);
    ResidentNode queryNode = mebn.getDomainResidentNode("isShipOfInterest");
   
    // Set up query
    List<OVInstance> ovInstanceList = new ArrayList<OVInstance>(1);
    List<Argument> arglist = queryNode.getArgumentList();
    OrdinaryVariable ov = arglist.get(0).getOVariable();
    OVInstance ovInstance = OVInstance.getInstance(ov,
        LiteralEntityInstance.getInstance("ship" + ship.getID(), ov.getValueType()));
    ovInstanceList.add(ovInstance);
    
View Full Code Here


   * @return the string
   * @throws Exception the exception
   */
  private String runQuery(ShipEntity ship) throws Exception {
     Debug.setDebug(false);
    ResidentNode queryNode = mebn.getDomainResidentNode("isShipOfInterest");
   
    // Set up query
    List<OVInstance> ovInstanceList = new ArrayList<OVInstance>(1);
    List<Argument> arglist = queryNode.getArgumentList();
    OrdinaryVariable ov = arglist.get(0).getOVariable();
    OVInstance ovInstance = OVInstance.getInstance(ov,
        LiteralEntityInstance.getInstance("ship" + ship.getID(), ov.getValueType()));
    ovInstanceList.add(ovInstance);
   
View Full Code Here

    ObjectEntity entity;
    String shipName;
    String ship2Name;
    String personName;
    String organizationName;
    ResidentNode residentNode;
    ObjectEntityInstance[] arguments;
    Entity state;
    CategoricalStateEntity categoricalState = null;
   
    entity = mebn.getObjectEntityContainer().getObjectEntityByName("Ship");
View Full Code Here

  /**
   * Load findings.
   */
  private void loadFindings() {

    ResidentNode residentNode = mebn
        .getDomainResidentNode("IsWithinRadarRange");
    ObjectEntityInstance[] arguments = new ObjectEntityInstance[2];
    arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName(
        "ship1");
    arguments[1] = mebn.getObjectEntityContainer().getEntityInstanceByName(
View Full Code Here

        mebnUtil.createEntityIntance(entity, "person1");
       
        entity = mebn.getObjectEntityContainer().getObjectEntityByName("Organization");
        mebnUtil.createEntityIntance(entity, "org1");
       
        ResidentNode residentNode = mebn.getDomainResidentNode("IsWithinRadarRange");
        ObjectEntityInstance[] arguments = new ObjectEntityInstance[2];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        arguments[1] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship2");
        Entity state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
View Full Code Here

      OrdinaryVariable[] ovFilledArray, LiteralEntityInstance[] entityFilledArray,
      InputNode inputNodeParent)
               throws ImplementationRestrictionException,
                      SSBNNodeGeneralException {
   
    ResidentNode residentNode = node.getResidentNode();
   
    //1) FIND THE ENTITY ORDEREABLE
    List<OrdinaryVariable> ovOrdereableList = residentNode.getOrdinaryVariablesOrdereables();
   
    if(ovOrdereableList.size() > 1){
      throw new ImplementationRestrictionException(
          ImplementationRestrictionException.MORE_THAN_ONE_ORDEREABLE_VARIABLE);
    }
   
    if(ovOrdereableList.size() < 1){
      throw new ImplementationRestrictionException(
          ImplementationRestrictionException.RV_NOT_RECURSIVE);
    }
   
    OrdinaryVariable ovOrdereable = ovOrdereableList.get(0); //Have only one element...
   
    //2) FIND THE PREVIOUS ELEMENT.
    ObjectEntity objectEntityOrdereable = residentNode.getMFrag().
                        getMultiEntityBayesianNetwork().getObjectEntityContainer().
                        getObjectEntityByType(ovOrdereable.getValueType());
 
    LiteralEntityInstance ovOrdereableActualValue = node.getEntityForOv(ovOrdereable);
    OVInstance ovInstanceOrdereable = OVInstance.getInstance(ovOrdereable, ovOrdereableActualValue);
View Full Code Here

            txtNameResident = new JTextField(5);

          txtNameResident.addKeyListener(new KeyAdapter() {
            public void keyPressed(KeyEvent e) {
              ResidentNode nodeAux = mebnController.getResidentNodeActive();

              if ((e.getKeyCode() == KeyEvent.VK_ENTER) && (txtNameResident.getText().length()>0)) {
                try {
                  String name = txtNameResident.getText(0,txtNameResident.getText().length());
                  matcher = wordPattern.matcher(name);
View Full Code Here

   * @see unbbayes.prs.Node#addParent(unbbayes.prs.Node)
   */
  public void addParent(Node parent) throws InvalidParentException {
    super.addParent(parent);
    if (parent instanceof ResidentNode) {
      ResidentNode residentNode = (ResidentNode) parent;
      residentNode.addResidentNodeChild(this); // this will automatically add parent to this.getResidentNodeFatherList()
    } else if (parent instanceof InputNode) {
      InputNode inputNode = (InputNode) parent;
      inputNode.addResidentNodeChild(this);
    } else {
      try {
View Full Code Here

  /*
   * (non-Javadoc)
   * @see edu.gmu.seor.prognos.unbbayesplugin.continuous.ssbn.INodeTranslator#translate(unbbayes.prs.INode, unbbayes.prs.Graph)
   */
  public INode translate(INode node, Graph network) {
    ResidentNode resident = ((SimpleSSBNNode)node).getResidentNode();
    if (resident instanceof ContinuousResidentNode) {
      return SSBNNode.getInstance((ProbabilisticNetwork)network, resident, new GmmNodePluginStub());
    }
    return SSBNNode.getInstance((ProbabilisticNetwork)network, resident);
  }
View Full Code Here

     * @see unbbayes.io.mebn.LoaderPrOwlIO#loadDomainResidentNode()
     */
    protected void loadDomainResidentNode() throws IOMebnException {

      MFrag domainMFrag;
      ResidentNode domainResidentNode;
      InputNode generativeInputNode;
      Argument argument;
      MultiEntityNode multiEntityNode;

      RDFIndividual individualOne;
      RDFIndividual individualTwo;
      OWLObjectProperty objectProperty;

      OWLNamedClass domainResidentNodePr = this.getOwlModel().getOWLNamedClass(DOMAIN_RESIDENT);
      Collection instances = domainResidentNodePr.getInstances(true);
      MFrag mFragOfNode = null;

      for (Iterator it = instances.iterator(); it.hasNext();) {

        individualOne = (RDFIndividual) it.next();
        domainResidentNode = getMapDomainResidentNode().get(individualOne
            .getBrowserText());
        if (domainResidentNode == null) {
          throw new IOMebnException(
              getResource().getString("DomainResidentNotExistsInMTheory"),
              individualOne.getBrowserText());
        }

        Debug.println("Domain Resident loaded: "
            + individualOne.getBrowserText());

        domainResidentNode.setDescription(getDescription(individualOne));

        /* -> isResidentNodeIn */
        objectProperty = (OWLObjectProperty) getOwlModel()
            .getOWLObjectProperty("isResidentNodeIn");
        instances = individualOne.getPropertyValues(objectProperty);
        Iterator itAux = instances.iterator();
        individualTwo = (RDFIndividual) itAux.next();
        domainMFrag = getMapDomainMFrag().get(individualTwo.getBrowserText());
        if (domainMFrag.containsDomainResidentNode(domainResidentNode) == false) {
          throw new IOMebnException(
              getResource().getString("DomainResidentNotExistsInDomainMFrag"));
        }
        mFragOfNode = domainMFrag;
        Debug.println("-> " + individualOne.getBrowserText() + ": "
            + objectProperty.getBrowserText() + " = "
            + individualTwo.getBrowserText());

        /* -> hasArgument */
        objectProperty = (OWLObjectProperty) getOwlModel()
            .getOWLObjectProperty("hasArgument");
        instances = individualOne.getPropertyValues(objectProperty);
        for (Iterator itIn = instances.iterator(); itIn.hasNext();) {
          individualTwo = (RDFIndividual) itIn.next();
          argument = new Argument(individualTwo.getBrowserText(),
              domainResidentNode);
          domainResidentNode.addArgument(argument);
          getMapArgument().put(individualTwo.getBrowserText(), argument);
          Debug.println("-> " + individualOne.getBrowserText() + ": "
              + objectProperty.getBrowserText() + " = "
              + individualTwo.getBrowserText());
        }

        /* -> hasParent */
        objectProperty = (OWLObjectProperty) getOwlModel()
            .getOWLObjectProperty("hasParent");
        instances = individualOne.getPropertyValues(objectProperty);
        for (Iterator itIn = instances.iterator(); itIn.hasNext();) {
          individualTwo = (RDFIndividual) itIn.next();
          if (getMapDomainResidentNode().containsKey(individualTwo
              .getBrowserText())) {
            ResidentNode aux = getMapDomainResidentNode().get(individualTwo
                .getBrowserText());

            Edge auxEdge = new Edge(aux, domainResidentNode);
            try {
              mFragOfNode.addEdge(auxEdge);
View Full Code Here

TOP

Related Classes of unbbayes.prs.mebn.ResidentNode

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.