ItEr30S17ValidacionEProbasFuncionais: Sorting the allocations is required by joining algorithm.

bug #48
This commit is contained in:
Óscar González Fernández 2009-10-19 00:06:59 +02:00
parent d836543b25
commit 0610cb2993

View file

@ -153,9 +153,10 @@ public class ResourceLoadModel implements IResourceLoadModel {
List<LoadTimelinesGroup> result = new ArrayList<LoadTimelinesGroup>();
for (Entry<Criterion, List<GenericResourceAllocation>> entry : genericAllocationsByCriterion
.entrySet()) {
List<GenericResourceAllocation> allocations = ResourceAllocation
.sortedByStartDate(entry.getValue());
LoadTimelinesGroup group = new LoadTimelinesGroup(createPrincipal(
entry.getKey(),
entry.getValue()), new ArrayList<LoadTimeLine>());
entry.getKey(), allocations), new ArrayList<LoadTimeLine>());
if (!group.isEmpty()) {
result.add(group);
}
@ -164,9 +165,9 @@ public class ResourceLoadModel implements IResourceLoadModel {
}
private LoadTimeLine createPrincipal(Criterion criterion,
List<GenericResourceAllocation> value) {
List<GenericResourceAllocation> orderedAllocations) {
return new LoadTimeLine(criterion.getName(), createPeriods(criterion,
value));
orderedAllocations));
}
private List<LoadPeriod> createPeriods(Criterion criterion,