ItEr60S08CUAsignacionRecursosLimitantesItEr59S08: Refactor.
Only the allocation is needed so the parameter list reduced to one parameter. Also renamed to reflect better meaning.
This commit is contained in:
parent
d3fcbde23c
commit
0cf1f3ebff
1 changed files with 11 additions and 11 deletions
|
|
@ -408,7 +408,7 @@ public class LimitingResourceQueueModel implements ILimitingResourceQueueModel {
|
|||
AllocationAttempt allocation = requirements
|
||||
.guessValidity(eachSubGap);
|
||||
if (allocation.isValid()) {
|
||||
doAllocation(requirements, allocation, eachSubGap.getOriginQueue());
|
||||
applyAllocation(allocation);
|
||||
return allocation;
|
||||
}
|
||||
}
|
||||
|
|
@ -424,21 +424,21 @@ public class LimitingResourceQueueModel implements ILimitingResourceQueueModel {
|
|||
return Collections.singletonList(each);
|
||||
}
|
||||
|
||||
private void doAllocation(InsertionRequirements requirements,
|
||||
AllocationAttempt allocation, LimitingResourceQueue queue) {
|
||||
private void applyAllocation(AllocationAttempt allocationStillNotDone) {
|
||||
LimitingResourceQueueElement element = allocationStillNotDone
|
||||
.getElement();
|
||||
LimitingResourceQueue queue = allocationStillNotDone.getQueue();
|
||||
Resource resource = queue.getResource();
|
||||
ResourceAllocation<?> resourceAllocation = requirements
|
||||
.getElement().getResourceAllocation();
|
||||
List<DayAssignment> assignments = allocation
|
||||
ResourceAllocation<?> resourceAllocation = element.getResourceAllocation();
|
||||
List<DayAssignment> assignments = allocationStillNotDone
|
||||
.getAssignmentsFor(resourceAllocation, resource);
|
||||
resourceAllocation
|
||||
.allocateLimitingDayAssignments(assignments);
|
||||
updateStartAndEndTimes(requirements.getElement(),
|
||||
allocation.getStartInclusive(), allocation
|
||||
updateStartAndEndTimes(element, allocationStillNotDone
|
||||
.getStartInclusive(), allocationStillNotDone
|
||||
.getEndExclusive());
|
||||
addLimitingResourceQueueElement(queue, requirements
|
||||
.getElement());
|
||||
markAsModified(requirements.getElement());
|
||||
addLimitingResourceQueueElement(queue, element);
|
||||
markAsModified(element);
|
||||
}
|
||||
|
||||
private DateAndHour getEndsAfterBecauseOfGantt(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue