Package org.drools.examples.manners.model

Examples of org.drools.examples.manners.model.Seat


                Context context = (Context) tuple.get( contextDeclD );

                List list = new ArrayList( );
                while ( seating != null )
                {
                    Seat seat = new Seat( seating.getSeat1( ),
                                          seating.getGuest1( ).getName( ) );
                    seating = seating.getPrevSeat( );
                    list.add( seat );
                }

                for ( int i = list.size( ); i > 0; i-- )
                {
                    Seat seat = (Seat) list.get( i - 1 );
                    System.out.println( seat );
                    try
                    {
                        workingMemory.assertObject( seat );
                    }
View Full Code Here


            if ( !( obj instanceof Seat ) )
            {
                continue;
            }

            Seat seat = ( Seat ) obj;
            if ( lastGuest == null )
            {
                lastGuest = guest4Seat( inList, seat );
            }

            Guest guest = guest4Seat( inList, seat );

            boolean hobbyFound = false;
            for ( int i = 0; !hobbyFound && i < lastGuest.getHobbies( ).size( ); i++ )
            {
                String hobby = ( String ) lastGuest.getHobbies( ).get( i );
                if ( guest.getHobbies( ).contains( hobby ) )
                {
                    hobbyFound = true;
                }
            }

            if ( !hobbyFound )
            {
                throw new RuntimeException( "seat: " + seat.getSeat( )
                                            + " no common hobby " + lastGuest
                                            + " -> " + guest );
            }
            seatCount++;
        }
View Full Code Here

TOP

Related Classes of org.drools.examples.manners.model.Seat

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.