Package org.drools.compiler

Examples of org.drools.compiler.Move


        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
        List<String> results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        ksession.insert( new Move( 1,
                                   2 ) );
        ksession.insert( new Move( 2,
                                   3 ) );

        Win win2 = new Win( 2 );
        Win win3 = new Win( 3 );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
        assertTrue( results.contains( win2 ) );
        assertTrue( results.contains( win3 ) );

        ksession.dispose();
        ksession = createKnowledgeSession( kbase );
        results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        // reverse the order of the inserts
        ksession.insert( new Move( 2,
                                   3 ) );
        ksession.insert( new Move( 1,
                                   2 ) );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
View Full Code Here


         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         List<String> results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         ksession.insert( new Move( 1,
                                    2 ) );
         ksession.insert( new Move( 2,
                                    3 ) );

         Win win2 = new Win( 2 );
         Win win3 = new Win( 3 );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
         assertTrue( results.contains( win2 ) );
         assertTrue( results.contains( win3 ) );

         ksession.dispose();
         ksession = createKnowledgeSession( kbase );
         results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         // reverse the order of the inserts
         ksession.insert( new Move( 2,
                                    3 ) );
         ksession.insert( new Move( 1,
                                    2 ) );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
View Full Code Here

         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         List<String> results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         ksession.insert( new Move( 1,
                                    2 ) );
         ksession.insert( new Move( 2,
                                    3 ) );

         Win win2 = new Win( 2 );
         Win win3 = new Win( 3 );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
         assertTrue( results.contains( win2 ) );
         assertTrue( results.contains( win3 ) );

         ksession.dispose();
         ksession = createKnowledgeSession( kbase );
         results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         // reverse the order of the inserts
         ksession.insert( new Move( 2,
                                    3 ) );
         ksession.insert( new Move( 1,
                                    2 ) );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
View Full Code Here

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
        List<String> results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        ksession.insert( new Move( 1,
                                   2 ) );
        ksession.insert( new Move( 2,
                                   3 ) );

        Win win2 = new Win( 2 );
        Win win3 = new Win( 3 );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
        assertTrue( results.contains( win2 ) );
        assertTrue( results.contains( win3 ) );

        ksession.dispose();
        ksession = createKnowledgeSession( kbase );
        results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        // reverse the order of the inserts
        ksession.insert( new Move( 2,
                                   3 ) );
        ksession.insert( new Move( 1,
                                   2 ) );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
View Full Code Here

         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         List<String> results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         ksession.insert( new Move( 1,
                                    2 ) );
         ksession.insert( new Move( 2,
                                    3 ) );

         Win win2 = new Win( 2 );
         Win win3 = new Win( 3 );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
         assertTrue( results.contains( win2 ) );
         assertTrue( results.contains( win3 ) );

         ksession.dispose();
         ksession = createKnowledgeSession( kbase );
         results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         // reverse the order of the inserts
         ksession.insert( new Move( 2,
                                    3 ) );
         ksession.insert( new Move( 1,
                                    2 ) );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
View Full Code Here

        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
        List<String> results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        ksession.insert( new Move( 1,
                                   2 ) );
        ksession.insert( new Move( 2,
                                   3 ) );

        Win win2 = new Win( 2 );
        Win win3 = new Win( 3 );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
        assertTrue( results.contains( win2 ) );
        assertTrue( results.contains( win3 ) );

        ksession.dispose();
        ksession = createKnowledgeSession( kbase );
        results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        // reverse the order of the inserts
        ksession.insert( new Move( 2,
                                   3 ) );
        ksession.insert( new Move( 1,
                                   2 ) );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
View Full Code Here

         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         List<String> results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         ksession.insert( new Move( 1,
                                    2 ) );
         ksession.insert( new Move( 2,
                                    3 ) );

         Win win2 = new Win( 2 );
         Win win3 = new Win( 3 );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
         assertTrue( results.contains( win2 ) );
         assertTrue( results.contains( win3 ) );

         ksession.dispose();
         ksession = createKnowledgeSession( kbase );
         results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         // reverse the order of the inserts
         ksession.insert( new Move( 2,
                                    3 ) );
         ksession.insert( new Move( 1,
                                    2 ) );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
View Full Code Here

         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         List<String> results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         ksession.insert( new Move( 1,
                                    2 ) );
         ksession.insert( new Move( 2,
                                    3 ) );

         Win win2 = new Win( 2 );
         Win win3 = new Win( 3 );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
         assertTrue( results.contains( win2 ) );
         assertTrue( results.contains( win3 ) );

         ksession.dispose();
         ksession = createKnowledgeSession( kbase );
         results = new ArrayList<String>();
         ksession.setGlobal( "results",
                             results );
         // reverse the order of the inserts
         ksession.insert( new Move( 2,
                                    3 ) );
         ksession.insert( new Move( 1,
                                    2 ) );

         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
View Full Code Here

        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
        List<String> results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        ksession.insert( new Move( 1,
                                   2 ) );
        ksession.insert( new Move( 2,
                                   3 ) );

        Win win2 = new Win( 2 );
        Win win3 = new Win( 3 );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
        assertTrue( results.contains( win2 ) );
        assertTrue( results.contains( win3 ) );

        ksession.dispose();
        ksession = createKnowledgeSession( kbase );
        results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        // reverse the order of the inserts
        ksession.insert( new Move( 2,
                                   3 ) );
        ksession.insert( new Move( 1,
                                   2 ) );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
View Full Code Here

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
        List<String> results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        ksession.insert( new Move( 1,
                                   2 ) );
        ksession.insert( new Move( 2,
                                   3 ) );

        Win win2 = new Win( 2 );
        Win win3 = new Win( 3 );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
        assertTrue( results.contains( win2 ) );
        assertTrue( results.contains( win3 ) );

        ksession.dispose();
        ksession = createKnowledgeSession( kbase );
        results = new ArrayList<String>();
        ksession.setGlobal( "results",
                            results );
        // reverse the order of the inserts
        ksession.insert( new Move( 2,
                                   3 ) );
        ksession.insert( new Move( 1,
                                   2 ) );

        ksession.fireAllRules();
        assertEquals( 2,
                      results.size() );
View Full Code Here

TOP

Related Classes of org.drools.compiler.Move

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.