ItEr59S08CUAsignacionRecursosLimitantesItEr58S10: [Bug #503] (Scenarios) It is impossible to add generic limiting resource allocation

This commit is contained in:
Diego Pino Garcia 2010-06-14 12:50:45 +02:00 committed by Javier Moran Rua
parent 401ac50fd9
commit aa9f6ca8ce
4 changed files with 7 additions and 7 deletions

View file

@ -128,10 +128,11 @@ public class GenericResourceAllocation extends
task));
}
public static GenericResourceAllocation create(Task task,
public static GenericResourceAllocation createForLimiting(Task task,
Collection<? extends Criterion> criterions) {
GenericResourceAllocation result = new GenericResourceAllocation(task);
result.criterions = new HashSet<Criterion>(criterions);
result.setResourcesPerDay(ResourcesPerDay.amount(1));
return create(result);
}

View file

@ -72,7 +72,7 @@ public class SpecificResourceAllocation extends
* @param task
* @return
*/
public static SpecificResourceAllocation create(Resource resource,
public static SpecificResourceAllocation createForLimiting(Resource resource,
Task task) {
assert resource.isLimitingResource();
SpecificResourceAllocation result = create(new SpecificResourceAllocation(

View file

@ -112,8 +112,7 @@ public class GenericAllocationRow extends AllocationRow {
}
private GenericResourceAllocation createGenericAllocation(Task task) {
GenericResourceAllocation result = GenericResourceAllocation.create(
task, criterions);
GenericResourceAllocation result = GenericResourceAllocation.createForLimiting(task, criterions);
GenericResourceAllocation origin = (GenericResourceAllocation) getOrigin();
if (origin != null) {
result.overrideAssignedHoursForResource(origin);

View file

@ -69,7 +69,7 @@ public class LimitingAllocationRow {
}
public static LimitingAllocationRow create(Resource resource, Task task) {
return new LimitingAllocationRow(SpecificResourceAllocation.create(resource, task), task);
return new LimitingAllocationRow(SpecificResourceAllocation.createForLimiting(resource, task), task);
}
private LimitingAllocationRow(ResourceAllocation<?> resourceAllocation,
@ -103,7 +103,7 @@ public class LimitingAllocationRow {
public static LimitingAllocationRow create(Set<Criterion> criteria,
Collection<? extends Resource> resources, Task task, int priority) {
LimitingAllocationRow result = new LimitingAllocationRow(
GenericResourceAllocation.create(task, criteria), task,
GenericResourceAllocation.createForLimiting(task, criteria), task,
priority);
result.setResources(resources);
return result;
@ -115,7 +115,7 @@ public class LimitingAllocationRow {
public static LimitingAllocationRow create(Resource resource, Task task,
int priority) {
return new LimitingAllocationRow(SpecificResourceAllocation.create(
return new LimitingAllocationRow(SpecificResourceAllocation.createForLimiting(
resource, task), task, priority);
}