// (the fact that latestEnd is exclusive is irrelevant because start = end - duration)
task.setStartPeriodRangeTo(latestEnd - duration + 1);
String[] usageLineTokens = splitBySpacesOrTabs(readStringValue(), resourceListSize);
List<TaskRequirement> taskRequirementListOfTask = new ArrayList<TaskRequirement>(resourceListSize);
for (int j = 0; j < resourceListSize; j++) {
TaskRequirement taskRequirement = new TaskRequirement();
taskRequirement.setId(taskRequirementId);
taskRequirementId++;
taskRequirement.setTask(task);
taskRequirement.setResource(solution.getResourceList().get(j));
taskRequirement.setResourceUsage(Integer.parseInt(usageLineTokens[j]));
taskRequirementList.add(taskRequirement);
taskRequirementListOfTask.add(taskRequirement);
}
task.setTaskRequirementList(taskRequirementListOfTask);
taskList.add(task);