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

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


    *
    * @param clique1
    * @param clique2
    */
    protected void absorb(Clique clique1, Clique clique2) {     
        Separator separator = getSeparator(clique1, clique2);
        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

TOP

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

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.