<commit_before>package org.navalplanner.business.planner.entities;


import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.Validate;
import org.hibernate.validator.NotNull;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.navalplanner.business.calendars.entities.BaseCalendar;
import org.navalplanner.business.calendars.entities.SameWorkHoursEveryDay;
import org.navalplanner.business.common.BaseEntity;

/**
 * Resources are allocated to planner tasks.
 *
 * @author <NAME> <<EMAIL>>
 */
public abstract class ResourceAllocation extends BaseEntity {

    public static class ResourceAllocationWithDesiredResourcesPerDay {

        private final ResourceAllocation resourceAllocation;

        private final ResourcesPerDay resourcesPerDay;

        private ResourceAllocationWithDesiredResourcesPerDay(ResourceAllocation resourceAllocation,
                ResourcesPerDay resourcesPerDay) {
            this.resourceAllocation = resourceAllocation;
            this.resourcesPerDay = resourcesPerDay;
        }

        public ResourceAllocation getResourceAllocation() {
            return resourceAllocation;
        }

        public ResourcesPerDay getResourcesPerDay() {
            return resourcesPerDay;
        }

    }

    @NotNull
    private Task task;

    private AssignmentFunction assignmentFunction;

    @NotNull
    private ResourcesPerDay resourcesPerDay;

    /**
     * Constructor for hibernate. Do not use!
     */
    public ResourceAllocation() {

    }

    protected void setResourcesPerDay(ResourcesPerDay resourcesPerDay) {
        Validate.notNull(resourcesPerDay);
        this.resourcesPerDay = resourcesPerDay;
    }

    public ResourceAllocation(Task task) {
        this(task, null);
    }

    public ResourceAllocation(Task task, AssignmentFunction assignmentFunction) {
        Validate.notNull(task);
        this.task = task;
        assignmentFunction = assignmentFunction;
    }

    protected ResourceAllocation(ResourcesPerDay resourcesPerDay, Task task) {
        this(task);
        Validate.notNull(resourcesPerDay);<commit_msg>ItEr25S07CUAsignacionGrupoRecursosAPlanificacionItEr24S08: Fixing error on instance variable assignmnet<commit_after>package org.navalplanner.business.planner.entities;


import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.Validate;
import org.hibernate.validator.NotNull;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.navalplanner.business.calendars.entities.BaseCalendar;
import org.navalplanner.business.calendars.entities.SameWorkHoursEveryDay;
import org.navalplanner.business.common.BaseEntity;

/**
 * Resources are allocated to planner tasks.
 *
 * @author <NAME> <<EMAIL>>
 */
public abstract class ResourceAllocation extends BaseEntity {

    public static class ResourceAllocationWithDesiredResourcesPerDay {

        private final ResourceAllocation resourceAllocation;

        private final ResourcesPerDay resourcesPerDay;

        private ResourceAllocationWithDesiredResourcesPerDay(ResourceAllocation resourceAllocation,
                ResourcesPerDay resourcesPerDay) {
            this.resourceAllocation = resourceAllocation;
            this.resourcesPerDay = resourcesPerDay;
        }

        public ResourceAllocation getResourceAllocation() {
            return resourceAllocation;
        }

        public ResourcesPerDay getResourcesPerDay() {
            return resourcesPerDay;
        }

    }

    @NotNull
    private Task task;

    private AssignmentFunction assignmentFunction;

    @NotNull
    private ResourcesPerDay resourcesPerDay;

    /**
     * Constructor for hibernate. Do not use!
     */
    public ResourceAllocation() {

    }

    protected void setResourcesPerDay(ResourcesPerDay resourcesPerDay) {
        Validate.notNull(resourcesPerDay);
        this.resourcesPerDay = resourcesPerDay;
    }

    public ResourceAllocation(Task task) {
        this(task, null);
    }

    public ResourceAllocation(Task task, AssignmentFunction assignmentFunction) {
        Validate.notNull(task);
        this.task = task;
        this.assignmentFunction = assignmentFunction;
    }

    protected ResourceAllocation(ResourcesPerDay resourcesPerDay, Task task) {
        this(task);
        Validate.notNull(resourcesPerDay);
{'fraction_non_alphanumeric': 0.06980482204362802, 'fraction_numerical': 0.0018369690011481056, 'mean_word_length': 3.4448979591836735, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6277956', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1120, 'n_words': 233}