Package org.integratedmodelling.riskwiz.domain

Examples of org.integratedmodelling.riskwiz.domain.DiscreteDomain


  public void print(Vector<DiscreteDomain> domainProduct, int[] aref,
            double value) {
        String printEntry = "\nP(";

        for (int i = 0; i < domainProduct.size(); i++) {
            DiscreteDomain dom = domainProduct.elementAt(i);
            String domName = dom.getName();

            printEntry += " " + dom.getName() + "=" + dom.getState(aref[i]);
            if (i == 0 && domainProduct.size() > 1) {
                printEntry += " |";
            } else if (i < aref.length - 1) {
                printEntry += ",";
            }
View Full Code Here


    protected int[] processQuery(List args) {
    
        int[] query = new int[parentsDomains.size()];

        for (int i = 0; i < parentsDomains.size(); i++) {
            DiscreteDomain pdom = parentsDomains.elementAt(i);
       
            query[i] = pdom.findState((String) args.get(i));
            // query[i]=(Integer)args.get(i); //pdom.findState((String) args.get(i));
        }
        return query;
    }
View Full Code Here

        w.write("       ");
        w.write("<decision");
        w.write(
                "    id=\"" + IOUtil.mangleXMLString(node.getName()) + "\" >"
                + ln);
        DiscreteDomain domain = (DiscreteDomain) node.getDomain();
        Vector<String> values = domain.getStates();

        // valueCache.put(nodeName, values);
        for (Iterator j = values.iterator(); j.hasNext();) {
            w.write(
                    "         <state id=\""
View Full Code Here

        w.write("       ");
        w.write("<cpt");
        w.write(
                "    id=\"" + IOUtil.mangleXMLString(node.getName()) + "\" >"
                + ln);
        DiscreteDomain domain = (DiscreteDomain) node.getDomain();
        Vector<String> values = domain.getStates();

        // valueCache.put(nodeName, values);
        for (Iterator j = values.iterator(); j.hasNext();) {
            w.write(
                    "         <state id=\""
View Full Code Here

        w.write("       ");
        w.write("<noisymax");
        w.write(
                "    id=\"" + IOUtil.mangleXMLString(node.getName()) + "\" >"
                + ln);
        DiscreteDomain domain = (DiscreteDomain) node.getDomain();
        Vector<String> values = domain.getStates();

        // valueCache.put(nodeName, values);
        for (Iterator j = values.iterator(); j.hasNext();) {
            w.write(
                    "         <state id=\""
View Full Code Here

        w.write("       ");
        w.write("<deterministic");
        w.write(
                "    id=\"" + IOUtil.mangleXMLString(node.getName()) + "\" >"
                + ln);
        DiscreteDomain domain = (DiscreteDomain) node.getDomain();
        Vector<String> values = domain.getStates();

        // valueCache.put(nodeName, values);
        for (Iterator j = values.iterator(); j.hasNext();) {
            w.write(
                    "         <state id=\""
View Full Code Here

        w.write("         <parents>");
        Vector<DiscreteDomain> parentDomains = ((TabularFunction) node.getFunction()).getParentsDomains();

        // System.out.println(node.getName());
        for (Iterator j = parentDomains.iterator(); j.hasNext();) {
            DiscreteDomain parentDom = (DiscreteDomain) j.next();
            String parentName = parentDom.getName();

            w.write(IOUtil.mangleXMLString(parentName));
            if (j.hasNext()) {
                w.write(" ");
            }
View Full Code Here

    }

    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

        Vector<DiscreteDomain> pdoms = dmap.getDiscretizedParentDomains();
        List args = new LinkedList();

        for (int i = 0; i < productStructureIterator.length; i++) {
            int j = productStructureIterator[i];
            DiscreteDomain ddom = pdoms.elementAt(i);

            if (ddom instanceof IntervalDomain) {
                IntervalDomain idom = (IntervalDomain) ddom;

                Double aval = new Double(idom.getAvarage(j));

                args.add(aval);

            } else {
                String sval = ddom.getState(i);

                args.add(sval);
            }

        }
View Full Code Here

        Vector<DiscreteDomain> pdoms = dmap.getDiscretizedParentDomains();
        List args = new LinkedList();

        for (int i = 0; i < productStructureIterator.length; i++) {
            int j = productStructureIterator[i];
            DiscreteDomain ddom = pdoms.elementAt(i);

            if (ddom instanceof IntervalDomain) {
                IntervalDomain idom = (IntervalDomain) ddom;

                Double aval = new Double(idom.getAvarage(j));

                args.add(aval);

            } else {
                String sval = ddom.getState(i);

                args.add(sval);
            }

        }
View Full Code Here

TOP

Related Classes of org.integratedmodelling.riskwiz.domain.DiscreteDomain

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.