Package org.libreplan.business.workingday

Examples of org.libreplan.business.workingday.ResourcesPerDay


                        readsAs(0, 6510) },
                { ResourcesPerDay.calculateFrom(seconds(1986), seconds(1000)),
                        readsAs(1, 9860) },
                periodicalNumber };
        for (Object[] pair : examples) {
            ResourcesPerDay first = (ResourcesPerDay) pair[0];
            Matcher<ResourcesPerDay> matcher = (Matcher<ResourcesPerDay>) pair[1];
            assertThat(first, matcher);
        }
    }
View Full Code Here


                { ResourcesPerDay.amount(1),
                    readsAs(0, 8000), readsAs(0, 2000) },
                { ResourcesPerDay.amount(new BigDecimal(0.5)),
                    readsAs(0, 4000),readsAs(0, 1000) } };
        for (Object[] eachExample : examples) {
            ResourcesPerDay toDistribute = (ResourcesPerDay) eachExample[0];
            Matcher<ResourcesPerDay> firstMatcher = (Matcher<ResourcesPerDay>) eachExample[1];
            Matcher<ResourcesPerDay> secondMatcher = (Matcher<ResourcesPerDay>) eachExample[2];
            ResourcesPerDay[] distribute = distributor.distribute(toDistribute);
            assertThat(distribute[0], firstMatcher);
            assertThat(distribute[1], secondMatcher);
View Full Code Here

    }

    @Test
    @Transactional
    public void canBeSavedAndRetrieved() {
        ResourcesPerDay resourcesPerDay = ResourcesPerDay
                .amount(new BigDecimal(2.7));
        givenEntity(resourcesPerDay);
        getSession().save(entity);
        getSession().flush();
        getSession().evict(entity);
View Full Code Here

    protected void updateResourcesPerDay() {
        if (!isSatisfied()) {
            return;
        }
        ResourcesPerDay resourcesPerDay = calculateResourcesPerDayFromAssignments(getAssignments());
        assert resourcesPerDay != null;
        this.resourcesPerDay = resourcesPerDay;
    }
View Full Code Here

    public ResourcesPerDay getIntendedResourcesPerDay() {
        return intendedResourcesPerDay;
    }

    private ResourcesPerDay getReassignationResourcesPerDay() {
        ResourcesPerDay intended = getIntendedResourcesPerDay();
        if (intended != null) {
            return intended;
        }
        return getResourcesPerDay();
    }
View Full Code Here

        Iterable<PartialDay> daysToIterate = startFor(min).daysUntil(
                endFor(max));

        EffortDuration sumTotalEffort = zero();
        EffortDuration sumWorkableEffort = zero();
        final ResourcesPerDay ONE_RESOURCE_PER_DAY = ResourcesPerDay.amount(1);

        for (PartialDay day : daysToIterate) {
            List<T> assignmentsAtDay = avoidNull(byDay.get(day.getDate()),
                    Collections.<T> emptyList());
            EffortDuration incrementWorkable = getAllocationCalendar()
View Full Code Here

                protected CapacityResult thereAreAvailableHoursFrom(
                        IntraDayDate dateFromWhichToAllocate,
                        ResourcesPerDayModification resourcesPerDayModification,
                        EffortDuration effortToAllocate) {
                    ICalendar calendar = getCalendar(resourcesPerDayModification);
                    ResourcesPerDay resourcesPerDay = resourcesPerDayModification
                            .getGoal();
                    AvailabilityTimeLine availability = resourcesPerDayModification
                            .getAvailability();
                    getDirection().limitAvailabilityOn(availability,
                            dateFromWhichToAllocate);
View Full Code Here

            ResourcesPerDayModification resourcesPerDayModification,
            EffortDuration allocatedLastDay,
            EffortDuration biggestLastAssignment,
            IntraDayDate end) {
        IntraDayDate result;
        ResourcesPerDay adjustBy = allocatedLastDay
                .equals(biggestLastAssignment) ? resourcesPerDayModification
                .getGoal() : ResourcesPerDay.amount(1);
        if (isForwardScheduling()) {
            result = plusEffort(end, allocatedLastDay);
            if (!resourcesPerDayModification
View Full Code Here

            List<T> value,
            IntraDayDate resultDate) {
        @SuppressWarnings("unchecked")
        ResourceAllocation<T> allocation = (ResourceAllocation<T>) modification
                .getBeingModified();
        ResourcesPerDay resourcesPerDay = modification.getGoal();
        setNewDataForAllocation(allocation, resultDate,
                resourcesPerDay, value);
    }
View Full Code Here

    public static List<ResourceAllocationWithDesiredResourcesPerDay> fromExistent(
            Collection<? extends ResourceAllocation<?>> allocations) {
        List<ResourceAllocationWithDesiredResourcesPerDay> result = new ArrayList<ResourceAllocationWithDesiredResourcesPerDay>();
        for (ResourceAllocation<?> resourceAllocation : allocations) {
            ResourcesPerDay perDay = resourceAllocation
                    .getResourcesPerDay();
            Validate.notNull(perDay);
            result.add(new ResourceAllocationWithDesiredResourcesPerDay(
                    resourceAllocation, perDay));
        }
View Full Code Here

TOP

Related Classes of org.libreplan.business.workingday.ResourcesPerDay

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.