Package org.integratedmodelling.riskwiz.pfunction

Examples of org.integratedmodelling.riskwiz.pfunction.TabularFunction


        return funcTableToCPT(node.getDiscretizedDomain(), funcTable);
    }

    private static PT detFtoPT(BNNode node) {
        TabularFunction detf = (TabularFunction) node.getFunction();
        PT pT = new PT(detf.getParentsDomains());
        DiscreteDomain dom = (DiscreteDomain) node.getDomain();
   
        for (int i = 0; i < detf.size(); i++) {

            String sstate = (String) detf.getValue(i);
            int value = dom.findState(sstate);

            pT.setValue(i, value);

        }
View Full Code Here


    private double getWeight(BNNode node) throws ParseException {
        List args;

        if (node.getFunction() instanceof TabularFunction) {
            args = getDiscreteArguments(node);
            TabularFunction func = (TabularFunction) node.getFunction();

            if (node.isProbabilistic()) {
                return ((TabularCPD) func).getProb(args, getEvidence(node));
            } else if (node.isDeterministic()) {
        
                Object val = func.getValue(args);
                int valIndex = ((DiscreteDomain) func.getDomain()).findState(
                        (String) val);

                if (valIndex == getEvidence(node)) {
                    return 1;
                } else {
                    return 0;
                }
            } else {
                return 0;
            }

        } else {
            args = getArguments(node);
            if (node.isProbabilistic()) {
                ICondProbDistrib func = (ICondProbDistrib) node.getFunction();
                int evidence = getEvidence(node);
                double probDensity = func.getProb(args,
                        getEvidenceAvarage(node, evidence));

                return probDensity * getEvidenceWidth(node, evidence);

            } else if (node.isDeterministic()) {
View Full Code Here

TOP

Related Classes of org.integratedmodelling.riskwiz.pfunction.TabularFunction

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.