Package org.integratedmodelling.riskwiz.pfunction

Examples of org.integratedmodelling.riskwiz.pfunction.TabularDetF


            this.function = new TabularCPD(dom, null);
            this.noisyT = new NoisyT(dom, null);
            break;

        case  deterministic:
            this.function = new TabularDetF(dom, null);
            break;      

        case  utility:
            this.function = new TabularUF(dom, null);
            break;
View Full Code Here


    public static void parseDetFTableString(String cptstring, BNNode node) {

        String[] expressions = cptstring.split(";");

        Vector<String> bifArray = new Vector<String>();
        TabularDetF cpf = (TabularDetF) node.getFunction();

        if (node.getDomType() == DomainType.labels
                || node.getDomType() == DomainType.intervals) {
            DiscreteDomain dom = (DiscreteDomain) cpf.getDomain();

            for (int i = 0; i < expressions.length; i++) {

                String token = expressions[i].trim();

                bifArray.add(token);
                // int k = dom.findState(token);
                // bifArray.add(String.valueOf(k));

            }

            cpf.setValues(bifArray);

        } else if (node.getDomType() == DomainType.continuous) {

            if (expressions.length == 1) {
                cpf.setAll(expressions[0]);

            } else {

                for (int i = 0; i < expressions.length; i++) {

                    String token = expressions[i].trim();

                    cpf.setValue(i, token);
                }
            }

        }
View Full Code Here

   
    }

    public static String saveDeterministicFTable(BNNode node) {
        String cpfString = new String();
        TabularDetF cpf = (TabularDetF) node.getFunction();

        if (node.getDomType() == DomainType.labels
                || node.getDomType() == DomainType.intervals) {

            for (int i = 0; i < cpf.size(); i++) {
                // int istate = (int) RT.eval(cpf.getValue(i));
                String sstate = (String) cpf.getValue(i);
        
                cpfString += sstate; // ((DiscreteDomain)cpf.getDomain()).getState(istate);
                cpfString += "; ";
            }

        } else if (node.getDomType() == DomainType.continuous) {

            for (int i = 0; i < cpf.size(); i++) {
                cpfString += RT.toString((cpf.getValue(i)));
                cpfString += "; ";

            }

        }
View Full Code Here

TOP

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

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.