Package org.integratedmodelling.riskwiz.influence

Examples of org.integratedmodelling.riskwiz.influence.JTPotential


    Hashtable< SJTEdge, SubtableFastMap2> subtableOpMapHash;
    Hashtable< SJTEdge, FMarginalizationMap> margMapHashPN;
 
    public SJTVertex(Set<BNNode> cl) {
        super(cl);
        potential = new JTPotential(cl);
   
        margMapHash = new Hashtable< SJTEdge, Vector<Object>>();
        subtableOpMapHash = new Hashtable<SJTEdge, SubtableFastMap2 >();
    }
View Full Code Here


        super();    
    }

    public SJTEdge(SJTVertex vt1, SJTVertex vt2) {
        super(vt1, vt2);    
        potential = new JTPotential(sepset);
    }
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(
                                node.getDiscretizedDomain()));

                clusterHash.put(node,
                        new ClusterBundle(parentCluster, fmap, mfmap,
                        liklihoodfmap));
            } else if (node.isUtility()) {
                JTPotential clusterPT = parentCluster.getPotential();
                Vector<DiscreteDomain> parentDomains = node.getDiscreteCPT().getParentsDomains();
                FastMap2 fmap = clusterPT.createSubtableFastMap(parentDomains);
                FMarginalizationMap mfmap = clusterPT.createFMarginalizationMap(
                        node.getDiscreteCPT().getParentsDomains());

                clusterHash.put(node,
                        new ClusterBundle(parentCluster, fmap, mfmap, null));
            } else if (node.isDecision()) {

                JTPotential clusterPT = parentCluster.getPotential();
                // PT nodePT = decisionPotentialHash.get(node);
                // FastMap2 fmap = clusterPT.createSubtableFastMap(nodePT);
                FMarginalizationMap mfmap = clusterPT.createFMarginalizationMap(
                        node.getDiscretizedDomain());
                FastMap2 liklihoodfmap = clusterPT.createSubtableFastMap(
                        DomainFactory.createDomainProduct(
                                node.getDiscretizedDomain()));

                clusterHash.put(node,
                        new ClusterBundle(parentCluster, null, mfmap,
View Full Code Here

        for (BNNode node : bNNodes) {
            if (node.isNature()) {
                ClusterBundle bundle = clusterHash.get(node);
                SJTVertex parentCluster = bundle.jtcluster;
                JTPotential clusterPT = parentCluster.getPotential();

                clusterPT.multiplyByProbabilitySubtable(node.getDiscreteCPT(),
                        bundle.fopmap);
            } /*
             * else if (node.isUtility()) { ClusterBundle bundle =
             * clusterHash.get(node); SJTVertex parentCluster =
             * bundle.jtcluster; JTPotential clusterPT =
             * parentCluster.getPotential();
             * clusterPT.addUtilitySubtable(node.getTable(), bundle.fopmap); }
             */ else if (node.isDecision()) {
                ClusterBundle bundle = clusterHash.get(node);
                SJTVertex parentCluster = bundle.jtcluster;
                JTPotential clusterPT = parentCluster.getPotential();
                FastMap2 fmap = clusterPT.createSubtableFastMap(
                        decisionPotentialHash.get(node));

                clusterPT.multiplyByProbabilitySubtable(
                        decisionPotentialHash.get(node), fmap);
            }

        }

View Full Code Here

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

        JTPotential clusterPT = parentCluster.getPotential();

        clusterPT.multiplyByProbabilitySubtable(node.getEvidence(),
                bundle.liklihoodfmap);
        propagateEvidence(parentCluster);
    }
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(
                                node.getDiscretizedDomain()));

                clusterHash.put(node,
                        new ClusterBundle(parentCluster, fmap, mfmap,
                        liklihoodfmap));
            } else if (node.isUtility()) {
                JTPotential clusterPT = parentCluster.getPotential();
                Vector<DiscreteDomain> parentDomains = node.getDiscreteCPT().getParentsDomains();
                FastMap2 fmap = clusterPT.createSubtableFastMap(parentDomains);
                FMarginalizationMap mfmap = clusterPT.createFMarginalizationMap(
                        node.getDiscreteCPT().getParentsDomains());

                clusterHash.put(node,
                        new ClusterBundle(parentCluster, fmap, mfmap, null));
            }
View Full Code Here

        for (BNNode node : bNNodes) {
            if (node.isNature()) {
                ClusterBundle bundle = clusterHash.get(node);
                SJTVertex parentCluster = bundle.jtcluster;
                JTPotential clusterPT = parentCluster.getPotential();

                clusterPT.multiplyByProbabilitySubtable(node.getDiscreteCPT(),
                        bundle.fopmap);
            } else if (node.isUtility()) {
                ClusterBundle bundle = clusterHash.get(node);
                SJTVertex parentCluster = bundle.jtcluster;
                JTPotential clusterPT = parentCluster.getPotential();

                clusterPT.addUtilitySubtable(node.getDiscreteCPT(),
                        bundle.fopmap);

            }

        }
View Full Code Here

    }

    public void initializeLikelihood(BNNode node) {
        ClusterBundle bundle = clusterHash.get(node);
        SJTVertex parentCluster = bundle.jtcluster;
        JTPotential clusterPT = parentCluster.getPotential();

        if (node.hasEvidence()) {

            clusterPT.multiplyByProbabilitySubtable(node.getEvidence(),
                    bundle.liklihoodfmap);

        }
    }
View Full Code Here

    }

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

        JTPotential sourcePT = source.getPotential();
        Vector<Object> mmaps = source.getMarginalizationFastMap(jtedge);

        // System.out.println("\nmapsize: "+ mmaps.size()+ " \n" );
        // for (Object object : mmaps) {
        // if (object instanceof MarginalizationFastMap) {
        // System.out.println( "marg," );
        // } else if (object instanceof DiscreteDomain) {
        //
        // System.out.println( "maxMarg," );
        // }
        // }
        sepsetPT = JTPotential.marginalizeDomainsSequence(sourcePT, mmaps,
                policyHash);
        jtedge.setPotential(sepsetPT);

        JTPotential targetPT = target.getPotential();

        SubtableFastMap2 fmap2 = target.getSubtableOpFastMap(jtedge);

        targetPT.multiplyBySubtableFast(sepsetPT, fmap2);

    }
View Full Code Here

TOP

Related Classes of org.integratedmodelling.riskwiz.influence.JTPotential

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.