ItEr59S08CUAsignacionRecursosLimitantesItEr58S10: Calculate earliestEndDateBecauseOfGantt too.
This commit is contained in:
parent
1cb60b00ba
commit
3c073c72ba
3 changed files with 40 additions and 0 deletions
|
|
@ -40,27 +40,49 @@ public class Dependency extends BaseEntity {
|
|||
public boolean modifiesDestinationStart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifiesDestinationEnd() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
START_START {
|
||||
@Override
|
||||
public boolean modifiesDestinationStart() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifiesDestinationEnd() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
END_END {
|
||||
@Override
|
||||
public boolean modifiesDestinationStart() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifiesDestinationEnd() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
START_END {
|
||||
@Override
|
||||
public boolean modifiesDestinationStart() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifiesDestinationEnd() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
public abstract boolean modifiesDestinationStart();
|
||||
|
||||
public abstract boolean modifiesDestinationEnd();
|
||||
}
|
||||
|
||||
public static Dependency create(TaskElement origin,
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public class LimitingResourceQueueElement extends BaseEntity {
|
|||
|
||||
private Date earlierStartDateBecauseOfGantt;
|
||||
|
||||
private Date earliestEndDateBecauseOfGantt;
|
||||
|
||||
private QueuePosition startQueuePosition;
|
||||
|
||||
private QueuePosition endQueuePosition;
|
||||
|
|
@ -185,6 +187,8 @@ public class LimitingResourceQueueElement extends BaseEntity {
|
|||
Collection<? extends Dependency> incomingDependencies) {
|
||||
this.earlierStartDateBecauseOfGantt = calculateStartDate(orderInitDate,
|
||||
incomingDependencies);
|
||||
this.earliestEndDateBecauseOfGantt = calculateEndDate(orderInitDate,
|
||||
incomingDependencies);
|
||||
}
|
||||
|
||||
private Date calculateStartDate(Date orderInitDate,
|
||||
|
|
@ -199,6 +203,18 @@ public class LimitingResourceQueueElement extends BaseEntity {
|
|||
return result;
|
||||
}
|
||||
|
||||
private Date calculateEndDate(Date orderInitDate,
|
||||
Collection<? extends Dependency> incomingDependencies) {
|
||||
Date result = null;
|
||||
for (Dependency each : incomingDependencies) {
|
||||
if (!each.isDependencyBetweenLimitedAllocatedTasks()
|
||||
&& each.getType().modifiesDestinationEnd()) {
|
||||
result = bigger(result, each.getDateFromOrigin());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Date bigger(Date one, Date another) {
|
||||
if (one == null) {
|
||||
return another;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@
|
|||
|
||||
<property name="earlierStartDateBecauseOfGantt" column="EARLIER_START_DATE_BECAUSE_OF_GANTT" />
|
||||
|
||||
<property name="earliestEndDateBecauseOfGantt" column="EARLIEST_END_DATE_BECAUSE_OF_GANTT" />
|
||||
|
||||
<property name="creationTimestamp" column="CREATION_TIMESTAMP" />
|
||||
|
||||
<component name="startQueuePosition" class="org.navalplanner.business.planner.entities.QueuePosition">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue