Package org.kie.api.runtime

Examples of org.kie.api.runtime.KieSession.fireAllRules()


    public void testCenterBasedClustering() throws Exception {
        setKSession( getModelSession( source1, VERBOSE ) );
        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        kSession.getEntryPoint( "in_Fld0" ).insert( "y" );
        kSession.getEntryPoint( "in_Fld1" ).insert( 2.0 );
        kSession.getEntryPoint( "in_Fld2" ).insert( -1.0 );
View Full Code Here


        kSession.getEntryPoint( "in_Fld0" ).insert( "y" );
        kSession.getEntryPoint( "in_Fld1" ).insert( 2.0 );
        kSession.getEntryPoint( "in_Fld2" ).insert( -1.0 );

        kSession.fireAllRules();
       
        FactType mu = kSession.getKieBase().getFactType( packageName, "DistanceMembership" );
        Collection mus = kSession.getObjects( new ClassObjectFilter( mu.getFactClass()) );
        assertTrue( mus.size() > 0 );
        for ( Object x : mus ) {
View Full Code Here

    public void testRegression() throws Exception {
        setKSession( getModelSession( source1, VERBOSE ) );
        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld4" );

        kSession.getEntryPoint( "in_Fld1" ).insert( 0.9 );
        kSession.getEntryPoint( "in_Fld2" ).insert( 0.3 );
View Full Code Here

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld4" );

        kSession.getEntryPoint( "in_Fld1" ).insert( 0.9 );
        kSession.getEntryPoint( "in_Fld2" ).insert( 0.3 );
        kSession.getEntryPoint( "in_Fld3" ).insert( "x" );
        kSession.fireAllRules();

        double x = 0.5
                   + 5 * 0.9 * 0.9
                   + 2 * 0.3
                   - 3.0
View Full Code Here

    public void testClassification() throws Exception {
        setKSession( getModelSession( source2, VERBOSE ) );
        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld4" );

        kSession.getEntryPoint( "in_Fld1" ).insert( 1.0 );
        kSession.getEntryPoint( "in_Fld2" ).insert( 1.0 );
View Full Code Here

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld4" );

        kSession.getEntryPoint( "in_Fld1" ).insert( 1.0 );
        kSession.getEntryPoint( "in_Fld2" ).insert( 1.0 );
        kSession.getEntryPoint( "in_Fld3" ).insert( "x" );
        kSession.fireAllRules();

        checkFirstDataFieldOfTypeStatus( kSession.getKieBase().getFactType( packageName, "RegOut" ),
                                            true, false, "LinReg", "catC" );
        checkFirstDataFieldOfTypeStatus( kSession.getKieBase().getFactType( packageName, "RegProb" ),
                                            true, false, "LinReg", 0.709228 );
View Full Code Here

    public void testSVM() throws Exception {
        setKSession( getModelSession( source1, VERBOSE ) );
        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType ztype = kSession.getKieBase().getFactType( packageName, "Z" );
        assertNotNull( ztype );

        kSession.getEntryPoint( "in_X" ).insert( 0.0 );
View Full Code Here

        FactType ztype = kSession.getKieBase().getFactType( packageName, "Z" );
        assertNotNull( ztype );

        kSession.getEntryPoint( "in_X" ).insert( 0.0 );
        kSession.getEntryPoint( "in_Y" ).insert( 0.0 );
        kSession.fireAllRules();
        System.out.println( reportWMObjects( kSession ) );
        checkFirstDataFieldOfTypeStatus( ztype, true, false, "SVMXORMODEL", "yes" );


        kSession.getEntryPoint( "in_X" ).insert( 0.23 );
View Full Code Here

        checkFirstDataFieldOfTypeStatus( ztype, true, false, "SVMXORMODEL", "yes" );


        kSession.getEntryPoint( "in_X" ).insert( 0.23 );
        kSession.getEntryPoint( "in_Y" ).insert( 0.75 );
        kSession.fireAllRules();
        checkFirstDataFieldOfTypeStatus( ztype, true, false, "SVMXORMODEL", "no" );


        kSession.getEntryPoint( "in_X" ).insert( 0.85 );
        kSession.fireAllRules();
View Full Code Here

        kSession.fireAllRules();
        checkFirstDataFieldOfTypeStatus( ztype, true, false, "SVMXORMODEL", "no" );


        kSession.getEntryPoint( "in_X" ).insert( 0.85 );
        kSession.fireAllRules();
        checkFirstDataFieldOfTypeStatus( ztype, true, false, "SVMXORMODEL", "yes" );

        kSession.getEntryPoint( "in_Y" ).insert( -0.12 );
        kSession.fireAllRules();
        checkFirstDataFieldOfTypeStatus( ztype, true, false, "SVMXORMODEL", "no" );
View Full Code Here

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.