Package edu.gmu.seor.prognos.unbbayesplugin.continuous.prs

Examples of edu.gmu.seor.prognos.unbbayesplugin.continuous.prs.ContinuousResidentNode


            }
          }

          // instanciate a continuous resident node instead of resident node, if individual is assignable to a continuous node
          if (individualTwo.hasRDFType(getOwlModel().getOWLNamedClass(CONTINUOUS_RESIDENT_NODE), true)) {
            domainResidentNode = new ContinuousResidentNode(name, domainMFrag);
//            try {
//              ((ContinuousResidentNode)domainResidentNode).onAddToMFrag(domainMFrag);
//            } catch (MFragDoesNotExistException e) {
//              e.printStackTrace();
//            }
View Full Code Here


 
  /* (non-Javadoc)
   * @see unbbayes.gui.table.extension.IProbabilityFunctionPanelBuilder#buildProbabilityFunctionEditionPanel()
   */
  public JPanel buildProbabilityFunctionEditionPanel() {
    ContinuousResidentNode node = (ContinuousResidentNode) this.getProbabilityFunctionOwner();
    IMEBNMediator mediator = node.getMediator();
   
    mediator.setActiveResidentNode(node);
    mediator.getMebnEditionPane().setEditArgumentsTabActive(node);
    mediator.getMebnEditionPane().setArgumentTabActive();

View Full Code Here

      for(MFrag mfrag: mebn.getMFragList()){
        // we are creating one continuous SSBN node per each possible combination of arguments in a continuous resident node
        for (Node node : mfrag.getNodes()) {
          if (node instanceof ContinuousResidentNode) {
           
            ContinuousResidentNode continuousResidentNode = (ContinuousResidentNode) node;
            if (continuousResidentNode.getOrdinaryVariableList() == null
                || continuousResidentNode.getOrdinaryVariableList().isEmpty()) {
              continue// go to next node
            }
           
            // prepare all possible combinations of arguments. The ovs are synchronized by index
            boolean hasAtLeastOneCombination = true// true if all Lists in combinator were filled
            List<List<LiteralEntityInstance>> combinator = new ArrayList<List<LiteralEntityInstance>>();
            for (OrdinaryVariable ov : continuousResidentNode.getOrdinaryVariableList()) {
              List<LiteralEntityInstance> contentOfCombinator = new ArrayList<LiteralEntityInstance>();
              // get all values for ov
              List<String> ovValues = knowledgeBase.getEntityByType(ov.getValueType().getName());
              if (ovValues.isEmpty()) {
                // this iterator cannot be filled, because ov has no possible values
                hasAtLeastOneCombination = false;
                break;
              }
              // add all possible values for ov
              for (String ovValue : ovValues) {
                contentOfCombinator.add(LiteralEntityInstance.getInstance(ovValue, ov.getValueType()));
              }
              combinator.add(contentOfCombinator);
            }
           
            // do not add node if there is some ov with no possible value (that means, no combination can be created)
            if (!hasAtLeastOneCombination) {
              continue// go to next continuous node
            }
           
            // list of indexes of combinator
            List<Integer> indexes = new ArrayList<Integer>(combinator.size());
            for (int i = 0; i < combinator.size(); i++) {
              // Note that at this point, each list in combinator has at least 1 element, because hasAtLeastOneCombination == true (so, 0 is a valid index)
              indexes.add(0);
            }
           
            /*
             * iterate on combinator using indexes.
             * E.g.:  combinator = {{a,b},{1,2}};
             *       then indexes must iterate like:
             *       {0,0}  (means (a,1));
             *       {1,0}  (means (b,1));
             *       {0,1}  (means (a,2));
             *       {1,1}  (means (b,2));
             *  
             */
            while (hasAtLeastOneCombination) {
             
              // create a continuous ssbn node for each possible combination of combinator
              SimpleSSBNNode ssbnNode = SimpleSSBNNode.getInstance(continuousResidentNode);
              ssbnNode.setFinished(false);
             
              // fill arguments of ssbnNode
              for (int i = 0; i < continuousResidentNode.getOrdinaryVariableList().size(); i++) {
                ssbnNode.setEntityForOv(
                    continuousResidentNode.getOrdinaryVariableList().get(i),
                    combinator.get(i).get(indexes.get(i))
                );
              }
             
              if (logManager != null) {
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    ContinuousResidentNode residentNode_ = new ContinuousResidentNode();
    residentNode_.setName("temp");
   
    CRN_CPTFrame test = new CRN_CPTFrame(null, residentNode_);
    test.setVisible(true);

  }
View Full Code Here

TOP

Related Classes of edu.gmu.seor.prognos.unbbayesplugin.continuous.prs.ContinuousResidentNode

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.