Package org.drools.beliefs.bayes.model

Examples of org.drools.beliefs.bayes.model.Bif


    @Override
    public void addResource(KnowledgeBuilder kbuilder, Resource resource, ResourceType type, ResourceConfiguration configuration) throws Exception {
        BayesNetwork network;
        JunctionTreeBuilder builder;

        Bif bif = XmlBifParser.loadBif(resource, kbuilder.getErrors());
        if (bif == null) {
            return;
        }

        try {
View Full Code Here


public class ParserTest {

    @Test
    public void testSprinklerLoadBif() {

        Bif bif = (Bif) XmlBifParser.loadBif(ParserTest.class.getResource("Garden.xmlbif"));
        Network network = bif.getNetwork();
        assertEquals( "Garden", network.getName() );
        assertEquals( "package = org.drools.beliefs.bayes.integration", network.getProperties().get(0) );

        Map<String, Variable> varMap = varToMap( network.getVariables() );
        assertEquals(4, varMap.size());
View Full Code Here

        assertEquals("0.5 0.5", def.getProbabilities().trim());
    }

    @Test
    public void testSprinklerBuildBayesNework() {
        Bif bif = (Bif) XmlBifParser.loadBif(ParserTest.class.getResource("Garden.xmlbif"));

        BayesNetwork network = XmlBifParser.buildBayesNetwork( bif );
        Map<String, GraphNode<BayesVariable>> map = nodeToMap(network);

        GraphNode<BayesVariable> node = map.get( "WetGrass" );
View Full Code Here

TOP

Related Classes of org.drools.beliefs.bayes.model.Bif

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.