Package edu.gmu.seor.prognos.unbbayesplugin.jt.prs.bn

Examples of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.bn.PotentialTable


        super.absorb(clique1, clique2);
//        clique1.absorb(clique2, separator.getPotentialTable());
        ArrayList<Node> toDie = SetToolkit.clone(clique2.getNodes());
        toDie.removeAll(separator.getNodes());

        PotentialTable originalSeparatorUtilityTable = (PotentialTable) separator.getUtilityTable().clone();

        PotentialTable dummyTable = (PotentialTable) clique2.getUtilityTable().clone();
        dummyTable.directOpTab(clique2.getPotentialTable(), PotentialTable.PRODUCT_OPERATOR);
        for (int i = 0; i < toDie.size(); i++) {
            dummyTable.removeVariable(toDie.get(i));
        }

        for (int i = separator.getUtilityTable().tableSize()-1; i >= 0; i--) {
            separator.getUtilityTable().setValue(i, dummyTable.getValue(i));
        }
        separator.getUtilityTable().directOpTab(separator.getPotentialTable(), PotentialTable.DIVISION_OPERATOR);
        dummyTable = (PotentialTable) separator.getUtilityTable().clone();
        dummyTable.directOpTab(originalSeparatorUtilityTable, PotentialTable.MINUS_OPERATOR);
        clique1.getUtilityTable().opTab(dummyTable, PotentialTable.PLUS_OPERATOR);
    }
View Full Code Here


        color = new Color(rgb);
    }
     
    protected void marginal() {
        marginalList = new float[getStatesSize()];
        PotentialTable auxTab = (PotentialTable)((Clique)cliqueAssociado).getUtilityTable().clone();
        auxTab.directOpTab(cliqueAssociado.getPotentialTable(), PotentialTable.PRODUCT_OPERATOR);
   /*     int index = auxTab.indexOfVariable(this);
        for (int i = 0; i < cliqueAssociado.getPotentialTable().variableCount(); i++) {
            if (i != index) {
                auxTab.removeVariable(cliqueAssociado.getPotentialTable().getVariableAt(i));
            }
View Full Code Here

      uNode.setDescription(sNode.getName());
    }
     
    //initialize Potential Table
    if (uNode instanceof ITabledVariable) {
      PotentialTable potTable = ((ITabledVariable)uNode).getPotentialTable();
      potTable.addVariable(uNode);
    }
   
    rede.addNode(uNode);
  }
View Full Code Here

      }
     
      /////////////////////////////////////////////////////////////////////////////////////
      //3. fill zero on table 
      ITabledVariable aux = null;
      PotentialTable auxTab = null;
      if (uNode instanceof ITabledVariable) {
        aux = (ITabledVariable) uNode;
        auxTab = aux.getPotentialTable() ;
      }
      
      int curStateSize = uNode.getStatesSize()
     
      for( INode parent : uNode.getParentNodes() )
        curStateSize *= parent.getStatesSize();
     
      for( int i = 0; i < curStateSize; i++ )
        auxTab.addValueAt(i, 0);
     
      auxTab.setTableSize(curStateSize);
   
      /////////////////////////////////////////////////////////////////////////////////////
      //4. add new values in the states of BN
      // EX]
      // CPT[Isa]parent1.state1{parent1.Name}[Isa]parent2.state1{parent2.Name}[Next]cur.state1[Next]cur.state2
View Full Code Here

    edge.getOriginNode().addChild(edge.getDestinationNode());
    edge.getDestinationNode().addParent(edge.getOriginNode());
      edgeList.add(edge);
      if (edge.getDestinationNode() instanceof ITabledVariable) {
      ITabledVariable v2 = (ITabledVariable) edge.getDestinationNode();
      PotentialTable auxTab = v2.getPotentialTable();
      auxTab.addVariable(edge.getOriginNode());
    }
  }
View Full Code Here

   *@param  elemento  edge to be removed
   */
  private void removeArco(Edge elemento) {
      Node auxNo;
      ITabledVariable auxTabledVariable;
      PotentialTable auxPotentialTable;
 
      edgeList.remove(elemento);
 
      auxNo = elemento.getDestinationNode();
      if (auxNo instanceof ITabledVariable) {
          auxTabledVariable = (ITabledVariable)auxNo;
          auxPotentialTable = auxTabledVariable.getPotentialTable();
          auxPotentialTable.removeVariable(elemento.getOriginNode(), true);
      }
  }
View Full Code Here

TOP

Related Classes of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.bn.PotentialTable

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.