Package org.libreplan.business.resources.entities

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


            IAssignedEffortForResource assignedEffortForEachResource,
            LocalDate date) {
        List<ShareSource> result = new ArrayList<ShareSource>();
        for (int i = 0; i < resources.size(); i++) {
            List<Share> shares = new ArrayList<Share>();
            Resource resource = resources.get(i).resource;
            ICalendar calendarForResource = resources.get(i).calendar;
            EffortDuration alreadyAssigned = assignedEffortForEachResource
                    .getAssignedDurationAt(resource, date);
            final int alreadyAssignedSeconds = alreadyAssigned.getSeconds();
            Integer capacityEachOneSeconds = calendarForResource.asDurationOn(
View Full Code Here


            @Override
            public void allocateDayAssigments(IntraDayDate start,
                    IntraDayDate end) {
                ResourceAllocation<?> resourceAllocation = getResourceAllocation(allocationStillNotDone);
                Resource resource = getResource(allocationStillNotDone);

                List<DayAssignment> assignments = allocationStillNotDone.getAssignmentsFor(
                        resourceAllocation, resource);
                resourceAllocation.allocateLimitingDayAssignments(assignments,
                        start, end);
View Full Code Here

                Collection<ResourceWithAssignedDuration> b) {
            Map<Resource, ResourceWithAssignedDuration> result = byResource(a);
            Map<Resource, ResourceWithAssignedDuration> byResource = byResource(b);
            for (Entry<Resource, ResourceWithAssignedDuration> each : byResource
                    .entrySet()) {
                Resource key = each.getKey();
                ResourceWithAssignedDuration value = each.getValue();
                if (result.containsKey(key)) {
                    result.put(key, result.get(key).plus(value));
                } else {
                    result.put(key, value);
View Full Code Here

                List<ShareSource> sources, int[] differencesInSeconds,
                List<Resource> resources) {
            List<ResourceWithAssignedDuration> result = new ArrayList<ResourceWithAssignedDuration>();
            int differencesIndex = 0;
            for (int i = 0; i < resources.size(); i++) {
                Resource resource = resources.get(i);
                ShareSource shareSource = sources.get(i);
                final int differencesToTake = shareSource.shares.size();
                int sum = sumDifferences(differencesInSeconds, differencesIndex,
                        differencesToTake);
                differencesIndex += differencesToTake;
View Full Code Here

                Iterator<DerivedDayAssignment> expectedIterator = expected
                        .iterator();
                while (argIterator.hasNext()) {
                    DerivedDayAssignment dayAssignment = argIterator.next();
                    DerivedDayAssignment expectedAssignment = expectedIterator.next();
                    Resource resource = dayAssignment.getResource();
                    Resource expectedResource = expectedAssignment
                            .getResource();
                    LocalDate day = dayAssignment.getDay();
                    LocalDate expectedDay = expectedAssignment.getDay();
                    int hours = dayAssignment.getHours();
                    int expectedHours = expectedAssignment
View Full Code Here

                workerToReturn);
        resourceDAOMock.save(workerToReturn);
        expectLastCall().andAnswer(new IAnswer<Object>() {
            @Override
            public Object answer() throws Throwable {
                Resource argument = (Resource) EasyMock.getCurrentArguments()[0];
                resourceDAO.save(argument);
                return null;
            }
        });
        replay(resourceDAOMock, criterionServiceMock);
View Full Code Here

     * @return
     */
    public static Gap getFirstValidGap(
            LimitingResourceQueue queue, LimitingResourceQueueElement element) {

        final Resource resource = queue.getResource();
        final List<LimitingResourceQueueElement> elements = new LinkedList<LimitingResourceQueueElement>(
                queue.getLimitingResourceQueueElements());
        final int size = elements.size();
        final DateAndHour startTime = getStartTimeBecauseOfGantt(element);

View Full Code Here

            LimitingResourceQueueElement element, LimitingResourceQueue queue,
            DateAndHour since) {

        List<Gap> result = new ArrayList<Gap>();

        final Resource resource = queue.getResource();
        final List<LimitingResourceQueueElement> elements = new LinkedList<LimitingResourceQueueElement>(
                queue.getLimitingResourceQueueElements());
        final int size = elements.size();

        int pos = moveUntil(elements, since);
View Full Code Here

        }
        return false;
    }

    private boolean acceptResource(FilterPair filter, TaskElement taskElement) {
        Resource filterResource = (Resource) filter.getValue();
        return existResourceInTaskElementResourceAllocations(filterResource,
                taskElement);
    }
View Full Code Here

    }

    private boolean acceptsResourceInResourceAllocation(
            Resource filterResource, ResourceAllocation<?> resourceAllocation) {
        if (resourceAllocation instanceof SpecificResourceAllocation) {
            Resource resource = ((SpecificResourceAllocation) resourceAllocation)
                    .getResource();
            if (resource.getId().equals(filterResource.getId())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

TOP

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

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.