Package org.drools.core.util

Examples of org.drools.core.util.BinaryHeapQueue


        public Group() {
        }

        public Group(final String name) {
            this.name = name;
            this.queue = new BinaryHeapQueue( ItemConflictResolver.INSTANCE );
        }
View Full Code Here


public class BinaryHeapPriorityQueueTest extends TestCase {
    public void testOptimised() {
        final Random random = new Random();
        final List items = new LinkedList();

        final Queue queue = new BinaryHeapQueue( NaturalComparator.INSTANCE,
                                                 100000 );

        for ( int i = 0; i < 100000; ++i ) {
            items.add( new LongQueueable( queue, random.nextLong() ) );
        }

        final long startEnqueue = System.currentTimeMillis();

        for ( final Iterator i = items.iterator(); i.hasNext(); ) {
            queue.enqueue( (Queueable) i.next() );
        }

        final long elapsedEnqueue = System.currentTimeMillis() - startEnqueue;

        final long startDequeue = System.currentTimeMillis();
View Full Code Here

    public void testBasic() {
        final Random random = new Random();
        final List items = new LinkedList();

        final BinaryHeapQueue queue = new BinaryHeapQueue( NaturalComparator.INSTANCE,
                                                           100000 );

        for ( int i = 0; i < 100000; ++i ) {
            items.add( new LongQueueable( queue, random.nextLong() ) );
        }

        final long startEnqueue = System.currentTimeMillis();

        for ( final Iterator i = items.iterator(); i.hasNext(); ) {
            queue.enqueue( (Queueable) i.next() );
        }

        final long elapsedEnqueue = System.currentTimeMillis() - startEnqueue;

        final long startDequeue = System.currentTimeMillis();

        for ( final Iterator i = items.iterator(); i.hasNext(); ) {
            queue.enqueue( (Queueable) i.next() );
        }

        //        while (!queue.isEmpty()) {
        //            queue.pop();
        //        }
View Full Code Here

    }


    public BinaryHeapQueueAgendaGroup(final String name, final InternalRuleBase ruleBase) {
        this.name = name;
        this.queue = new BinaryHeapQueue( ruleBase.getConfiguration().getConflictResolver() );
    }
View Full Code Here

        this.pmem = pmem;
        this.ruleAgendaItem = ruleAgendaItem;
        this.tupleList = new LeftTupleList();
        this.declarativeAgendaEnabled = declarativeAgendaEnabled;
        if (ruleAgendaItem.getRule().getSalience().isDynamic()) {
            queue = new BinaryHeapQueue(SalienceComparator.INSTANCE);
        }
    }
View Full Code Here

        this.pmem = pmem;
        this.ruleAgendaItem = ruleAgendaItem;
        this.tupleList = new LeftTupleList();
        this.declarativeAgendaEnabled = declarativeAgendaEnabled;
        if (ruleAgendaItem.getRule().getSalience().isDynamic()) {
            queue = new BinaryHeapQueue(SalienceComparator.INSTANCE);
        }
    }
View Full Code Here

    }

    public BinaryHeapQueueAgendaGroup(final String name,
                                      final InternalRuleBase ruleBase) {
        this.name = name;
        this.queue = new BinaryHeapQueue( ruleBase.getConfiguration().getConflictResolver() );
    }
View Full Code Here

        public Group() {
        }

        public Group(final String name) {
            this.name = name;
            this.queue = new BinaryHeapQueue( ItemConflictResolver.INSTANCE );
        }
View Full Code Here

        this.pmem = pmem;
        this.ruleAgendaItem = ruleAgendaItem;
        this.tupleList = new LeftTupleList();
        this.declarativeAgendaEnabled = declarativeAgendaEnabled;
        if (ruleAgendaItem.getRule().getSalience().isDynamic() ) {
            queue = new BinaryHeapQueue(SalienceComparator.INSTANCE);
        }
    }
View Full Code Here

        this.pmem = pmem;
        this.ruleAgendaItem = ruleAgendaItem;
        this.tupleList = new LeftTupleList();
        this.declarativeAgendaEnabled = declarativeAgendaEnabled;
        if (ruleAgendaItem.getRule().getSalience().isDynamic()) {
            queue = new BinaryHeapQueue(SalienceComparator.INSTANCE);
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.core.util.BinaryHeapQueue

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.