Package org.integratedmodelling.riskwiz.tests

Source Code of org.integratedmodelling.riskwiz.tests.Buggy

package org.integratedmodelling.riskwiz.tests;


import java.io.FileInputStream;

import org.integratedmodelling.riskwiz.bn.BNNode;
import org.integratedmodelling.riskwiz.bn.BeliefNetwork;
import org.integratedmodelling.riskwiz.inference.ls.JoinTreeCompiler;
import org.integratedmodelling.riskwiz.io.genie.GenieReader;
import org.integratedmodelling.riskwiz.io.xmlbif.XmlBifReader;
import org.integratedmodelling.riskwiz.jtree.JTInference;


public class Buggy {

    /**
     * @param args
     */
    public static void main(String[] args) {
   
        GenieReader r = new GenieReader();
        XmlBifReader rb = new XmlBifReader();

        try {
         
            System.out.println("ciao");
            BeliefNetwork bn = r.load(new FileInputStream("examples/water.xdsl"));
            // BeliefNetwork bn =rb.load(new FileInputStream("examples/sprinkler.xml"));

            JTInference inference = new JTInference();

            inference.initialize(bn, new JoinTreeCompiler());
            // inference.setObservation("Cloudy", "true");
            inference.run();
       
            for (BNNode n : bn.vertexSet()) {
                System.out.println(n.getName() + ": " + n.getMarginal());
            }
       
        } catch (Exception e) {

            e.printStackTrace();
        }
       
    }

}
TOP

Related Classes of org.integratedmodelling.riskwiz.tests.Buggy

TOP
Copyright © 2018 www.massapi.com. 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.