Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.LimitingResourceQueue


    private TreeitemRenderer getRendererForTree() {
        return new TreeitemRenderer() {
            @Override
            public void render(Treeitem item, Object data)
                    {
                LimitingResourceQueue line = (LimitingResourceQueue) data;
                item.setOpen(false);
                item.setValue(line);

                Treerow row = new Treerow();
                Treecell cell = new Treecell();
View Full Code Here


    private AllocationSpec doAppropriativeAllocation(
            InsertionRequirements requirements, AllocationSpec allocation) {

        LimitingResourceQueueElement element = requirements.getElement();
        List<LimitingResourceQueue> potentiallyValidQueues = getAssignableQueues(element);
        LimitingResourceQueue queue = earliestQueue(potentiallyValidQueues);

        List<LimitingResourceQueueElement> unscheduled = new ArrayList<LimitingResourceQueueElement>();
        allocation = unscheduleElementsFor(queue, requirements, unscheduled);
        allocation.setUnscheduledElements(queuesState.inTopologicalOrder(unscheduled));
        return allocation;
View Full Code Here

     * @return
     */
    private LimitingResourceQueue earliestQueue(
            List<LimitingResourceQueue> potentiallyValidQueues) {

        LimitingResourceQueue result = null;
        LocalDate latestDate = null;

        for (LimitingResourceQueue each : potentiallyValidQueues) {
            SortedSet<LimitingResourceQueueElement> elements = each
                    .getLimitingResourceQueueElements();
View Full Code Here

                convert(allocationStillNotDone.getStartInclusive()),
                convert(allocationStillNotDone.getEndExclusive()));

        LimitingResourceQueueElement element = allocationStillNotDone
            .getElement();
        LimitingResourceQueue queue = allocationStillNotDone.getQueue();

        // Update start and end time of task
        updateStartAndEndTimes(element, allocationStillNotDone
                .getStartInclusive(), allocationStillNotDone
                        .getEndExclusive());
View Full Code Here

            LimitingResourceQueueElement _element,
            LimitingResourceQueue _queue, DateAndHour allocationTime) {

        Set<LimitingResourceQueueElement> result = new HashSet<LimitingResourceQueueElement>();

        LimitingResourceQueue queue = queuesState.getEquivalent(_queue);
        LimitingResourceQueueElement element = queuesState.getEquivalent(_element);

        InsertionRequirements requirements = queuesState
                .getRequirementsFor(element, allocationTime);
View Full Code Here

        return timeTrackerComponent.getTimeTracker();
    }

    public void unschedule(QueueTask task) {
        LimitingResourceQueueElement queueElement = task.getLimitingResourceQueueElement();
        LimitingResourceQueue queue = queueElement.getLimitingResourceQueue();

        limitingResourcesController.unschedule(task);
        removeQueueTask(task);
        dependencyList.removeDependenciesFor(queueElement);
        queueListComponent.removeQueueElementFrom(queue, queueElement);
View Full Code Here

         */
        public static GapOnQueueWithQueueElement coalesce(
                GapOnQueueWithQueueElement first,
                GapOnQueueWithQueueElement second) {

            LimitingResourceQueue queue = first.getGapOnQueue()
                    .getOriginQueue();
            DateAndHour startTime = first.getGapOnQueue().getGap()
                    .getStartTime();
            DateAndHour endTime = second.getGapOnQueue().getGap().getEndTime();
            Gap coalescedGap = Gap.create(queue.getResource(), startTime,
                    endTime);

            return create(coalescedGap.onQueue(queue), second.getQueueElement());
        }
View Full Code Here

    }

    @Test
    @Transactional
    public void testSaveLimitingResourceQueue() {
        LimitingResourceQueue limitingResourceQueue = createValidLimitingResourceQueue();
        limitingResourceQueueDAO.save(limitingResourceQueue);
        assertTrue(limitingResourceQueueDAO.exists(limitingResourceQueue.getId()));
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testRemoveLimitingResourceQueue() throws InstanceNotFoundException {
        LimitingResourceQueue limitingResourceQueue = createValidLimitingResourceQueue();
        limitingResourceQueueDAO.save(limitingResourceQueue);
        limitingResourceQueueDAO.remove(limitingResourceQueue.getId());
        assertFalse(limitingResourceQueueDAO.exists(limitingResourceQueue.getId()));
    }
View Full Code Here

    @Test
    @Transactional
    public void testListLimitingResourceQueue() {
        int previous = limitingResourceQueueDAO.list(LimitingResourceQueue.class).size();

        LimitingResourceQueue limitingResourceQueue1 = createValidLimitingResourceQueue();
        limitingResourceQueueDAO.save(limitingResourceQueue1);
        LimitingResourceQueue limitingResourceQueue2 = createValidLimitingResourceQueue();
        limitingResourceQueueDAO.save(limitingResourceQueue1);
        limitingResourceQueueDAO.save(limitingResourceQueue2);

        List<LimitingResourceQueue> list = limitingResourceQueueDAO
                .list(LimitingResourceQueue.class);
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.LimitingResourceQueue

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.