Package org.integratedmodelling.riskwiz.bn

Examples of org.integratedmodelling.riskwiz.bn.BeliefNetwork


     */
    public static void decision(String bifFile) {
        // load network

        XmlBifReader bifReader = new XmlBifReader();
        BeliefNetwork network;

        try {
            network = bifReader.loadFromFile(bifFile);
            if (network == null) {
                System.out.println("Problems with loading the  network");
                return;
            }
            JTSolver solver = new JTSolver();

            solver.initialize(network, new StrongJoinTreeCompiler());
   
            // find the optimum actions
            solver.Solve()
   
            // show polices
            Set<BNNode> nodes = network.vertexSet();

            for (BNNode node : nodes) {
                if (node.isDecision()) {
                    System.out.println(
                            node.getName() + ":\n"
View Full Code Here


 
    public static void policyNetwork(String bifFile) {
        // load network

        XmlBifReader bifReader = new XmlBifReader();
        BeliefNetwork network;

        try {
            network = bifReader.loadFromFile(bifFile);
            if (network == null) {
                System.out.println("Problems with loading the  network");
                return;
            }
     
            // need to use JTSolverPN to provide the policy network
            JTSolverPN solver = new JTSolverPN();

            solver.initialize(network, new StrongJoinTreeCompiler());
   
            // find the optimum actions
            solver.Solve()
   
            JTInferencePN inference = solver.getPolicyNetworkInference();
   
            inference.run();

            // output inference results

            Set<BNNode> nodes = network.vertexSet();

            for (BNNode node : nodes) {
                System.out.println(
                        node.getName() + ":\n"
                        + inference.getMarginal(node).toString() + "\n");
View Full Code Here

    public static void bifToGenie(String fileIn, String fileOut) {
        XmlBifReader r = new XmlBifReader();
        GenieWriter w = new  GenieWriter();

        try {
            BeliefNetwork bn = r.load(new FileInputStream(fileIn));
            
            System.out.println("----------------------------------")
            w.save(System.out, bn);
            w.saveToFile(fileOut, bn);
        } catch (Exception e) {
View Full Code Here

    public static void genieToBif(String fileIn, String fileOut) {
        GenieReader r = new GenieReader();
        XmlBifWriter w = new  XmlBifWriter();

        try {
            BeliefNetwork bn = r.load(new FileInputStream(fileIn));
            
            System.out.println("----------------------------------")
            w.save(System.out, bn);
            w.saveToFile(fileOut, bn);
        } catch (Exception e) {
View Full Code Here

    public static void genieToRiskwiz(String fileIn, String fileOut) {
        GenieReader r = new GenieReader();
        RiskWizWriter w = new  RiskWizWriter();

        try {
            BeliefNetwork bn = r.load(new FileInputStream(fileIn));
            
            System.out.println("----------------------------------")
            w.save(System.out, bn);
            w.saveToFile(fileOut, bn);
        } catch (Exception e) {
View Full Code Here

 
    public static void carbonTest() {
        RiskWizReader gReader = new RiskWizReader();

        try {
            BeliefNetwork network = gReader.loadFromFile("examples/carbon5.rwz");

            if (network == null) {
                System.out.println("Can't load network");
                return;
            }
            JTInference inference = new JTInference();

            // JTCompilerDebugger deb = new JTCompilerDebugger();
            // deb.doAll();
            // //   
            inference.initialize(network, new JoinTreeCompiler());
            inference.run();
    
            Set<BNNode> nodes = network.vertexSet();

            for (BNNode node : nodes) {
                System.out.println(
                        node.getName() + ":\n" + node.getMarginal().toString()
                        + "\n");
View Full Code Here

TOP

Related Classes of org.integratedmodelling.riskwiz.bn.BeliefNetwork

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.