Package org.integratedmodelling.riskwiz.pt

Examples of org.integratedmodelling.riskwiz.pt.PT


        for (BNNode node : bNNodes) {
            if (node.isNature()) {
                boolean debugInit = false;
                JTVertexHugin parentCluster = assignParentCluster(node);

                PT clusterPT = parentCluster.getPt();
                PT nodePT = node.getDiscreteCPT();
                SubtableFastMap2 fmap = clusterPT.createSubtableFastMap(nodePT);
                FMarginalizationMap mfmap = new FMarginalizationMap(
                        clusterPT.getDomainProduct(),
                        node.getDiscretizedDomain());
            
View Full Code Here


        for (BNNode node : bNNodes) {
            if (node.isNature()) {
                ClusterBundle bundle = clusterHash.get(node);
                JTVertexHugin parentCluster = bundle.jtcluster;
                PT clusterPT = parentCluster.getPt();
                PT nodePT = node.getDiscreteCPT();
                SubtableFastMap2 fmap = (SubtableFastMap2) bundle.fopmap;

                // FMarginalizationMap mfmap = bundle.mfmap;
                // FastMap2 liklihoodfmap = bundle.liklihoodfmap;
                // if(init)System.out.println( "clusterPT \n"+
View Full Code Here

    }

    public void initializeLikelihood(BNNode node) {
        ClusterBundle bundle = clusterHash.get(node);
        JTVertexHugin parentCluster = bundle.jtcluster;
        PT clusterPT = parentCluster.getPt();

        if (node.hasEvidence()) {
      
            // cross fingers
            if (bundle.liklihoodfmap instanceof SubtableFastMap2) {
                clusterPT.multiplyBySubtableFast(node.getEvidence(),
                        (SubtableFastMap2) bundle.liklihoodfmap);
            } else {
                clusterPT.multiplyBySubtable(node.getEvidence(),
                        bundle.liklihoodfmap);
            }

        }
    }
View Full Code Here

    @Override
  public void propagateEvidence(BNNode node) {
        ClusterBundle bundle = clusterHash.get(node);
        JTVertexHugin parentCluster = bundle.jtcluster;

        PT clusterPT = parentCluster.getPt();

        clusterPT.multiplyBySubtable(node.getEvidence(), bundle.liklihoodfmap);
        unmarkAll();
        collectEvidence(parentCluster);
        unmarkAll();
        distributeEvidence(parentCluster);
    }
View Full Code Here

    @Override
  public void passMessage(JTVertexHugin source, JTVertexHugin target) {

        JTEdgeHugin jtedge = this.getEdge(source, target);
        PT sepsetPT = jtedge.getPt();
    
        // System.out.println("was \n"+ sepsetPT.toString());

        PT oldSepsetPT = sepsetPT.clone();
        PT sourcePT = source.getPt();

        FMarginalizationMap mmap = source.getFMarginalizationMap(jtedge);

        PT.marginalizeDomainsFast(sepsetPT, sourcePT, mmap);
     
        // System.out.println("become \n"+ sepsetPT.toString());
        PT targetPT = target.getPt();
    
        SubtableFastMap2 fmap2 = target.getSubtableOpFastMap(jtedge);

        targetPT.multiplyAndDivideBySubtableFast(sepsetPT, oldSepsetPT, fmap2);
    
    }
View Full Code Here

        for (BNNode node : bNNodes) {
            if (node.isNature()) {
                ClusterBundle cbundle = clusterHash.get(node);
                JTVertexHugin jtcluster = cbundle.jtcluster;
                FMarginalizationMap mfmap = cbundle.mfmap;
                PT marginal = new PT(mfmap.getProjectionDomainProduct());

                PT.marginalizeDomainsFast(marginal, jtcluster.getPt(), mfmap);
                // MarginalizationDomainMap mfmap = cbundle.mfmap;
                // node.setMarginal(PT.marginalizeDomains(jtcluster.getPt(),
                // mfmap));
View Full Code Here

            if (node.isNature()) {
                ClusterBundle cbundle = clusterHash.get(node);
                JTVertexHugin jtcluster = cbundle.jtcluster;
                FMarginalizationMap mfmap = cbundle.mfmap;

                PT marginal = new PT(mfmap.getProjectionDomainProduct());

                PT.marginalizeDomainsFast(marginal, jtcluster.getPt(), mfmap);
                // MarginalizationDomainMap mfmap = cbundle.mfmap;
                // PT marginal = PT.marginalizeDomains(jtcluster.getPt(),
                // mfmap);
                marginal.normalize();
                node.setMarginal(marginal);
            }

        }
    }
View Full Code Here

            SJTVertex parentCluster = assignParentCluster(node);

            if (node.isNature()) {

                JTPotential clusterPT = parentCluster.getPotential();
                PT nodePT = node.getDiscreteCPT();
                FastMap2 fmap = clusterPT.createSubtableFastMap(nodePT);
                FMarginalizationMap mfmap = clusterPT.createFMarginalizationMap(
                        node.getDiscretizedDomain());
                FastMap2 liklihoodfmap = clusterPT.createSubtableFastMap(
                        DomainFactory.createDomainProduct(
View Full Code Here

    @Override
  public void passMessage(SJTVertex source, SJTVertex target) {
        // boolean pp=false;
        SJTEdge jtedge = this.getEdge(source, target);
        PT sepsetPT = jtedge.getPotential().getProbabilityPotential();

        PT oldSepsetPT = sepsetPT.clone();
        PT sourcePT = source.getPotential().getProbabilityPotential();

        FMarginalizationMap mmap = source.getFMarginalizationMapPN(jtedge);

        PT.marginalizeDomainsFast(sepsetPT, sourcePT, mmap);

        PT targetPT = target.getPotential().getProbabilityPotential();

        SubtableFastMap2 fmap2 = target.getSubtableOpFastMap(jtedge);

        targetPT.multiplyBySubtableFast(sepsetPT, fmap2);
        targetPT.divideBySubtableFast(oldSepsetPT, fmap2);

    }
View Full Code Here

        for (BNNode node : bNNodes) {
            if (node.isNature() || node.isDecision()) {
                ClusterBundle cbundle = clusterHash.get(node);
                SJTVertex jtcluster = cbundle.jtcluster;
                FMarginalizationMap mfmap = cbundle.mfmap;
                PT marginal = new PT(mfmap.getProjectionDomainProduct());

                PT.marginalizeDomainsFast(marginal,
                        jtcluster.getPotential().getProbabilityPotential(),
                        mfmap);
                node.setMarginal(marginal);
            } else if (node.isUtility()) {
                ClusterBundle cbundle = clusterHash.get(node);
                SJTVertex jtcluster = cbundle.jtcluster;
                PT utility = jtcluster.getPotential().getProbabilityPotential().clone();

                utility.multiplyBySubtable(node.getDiscreteCPT(), cbundle.fopmap);
                node.setMarginalUtility(utility.sum());
            }

        }
    }
View Full Code Here

TOP

Related Classes of org.integratedmodelling.riskwiz.pt.PT

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.