[Bug #871] Fixed problem in critical path when dependencies are violated by constraints.
FEA: ItEr71S04BugFixing
This commit is contained in:
parent
6537c64484
commit
9af91d31d7
1 changed files with 14 additions and 18 deletions
|
|
@ -264,7 +264,7 @@ public class CriticalPathCalculator<T, D extends IDependency<T>> {
|
|||
Node<T, D> node = nodes.get(task);
|
||||
DependencyType dependencyType = getDependencyTypeEndStartByDefault(
|
||||
currentTask, task);
|
||||
Constraint<GanttDate> constraint = getDateStartConstraint(task);
|
||||
Constraint<GanttDate> constraint = getDateConstraints(task);
|
||||
|
||||
switch (dependencyType) {
|
||||
case START_START:
|
||||
|
|
@ -303,30 +303,26 @@ public class CriticalPathCalculator<T, D extends IDependency<T>> {
|
|||
node.setEarliestStart(earliestStart);
|
||||
}
|
||||
|
||||
private Constraint<GanttDate> getDateStartConstraint(T task) {
|
||||
private Constraint<GanttDate> getDateConstraints(T task) {
|
||||
if (task == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Constraint<GanttDate>> constraints = graph
|
||||
List<Constraint<GanttDate>> startConstraints = graph
|
||||
.getStartConstraintsFor(task);
|
||||
if (constraints == null) {
|
||||
return null;
|
||||
}
|
||||
return Constraint.coalesce(constraints);
|
||||
}
|
||||
|
||||
private Constraint<GanttDate> getDateEndConstraint(T task) {
|
||||
if (task == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Constraint<GanttDate>> constraints = graph
|
||||
List<Constraint<GanttDate>> endConstraints = graph
|
||||
.getEndConstraintsFor(task);
|
||||
if (constraints == null) {
|
||||
if ((startConstraints == null) && (endConstraints == null)) {
|
||||
return null;
|
||||
}
|
||||
return Constraint.coalesce(constraints);
|
||||
if (startConstraints == null) {
|
||||
return Constraint.coalesce(endConstraints);
|
||||
}
|
||||
if (endConstraints == null) {
|
||||
return Constraint.coalesce(startConstraints);
|
||||
}
|
||||
startConstraints.addAll(endConstraints);
|
||||
return Constraint.coalesce(startConstraints);
|
||||
}
|
||||
|
||||
private void backward(Node<T, D> currentNode, T nextTask) {
|
||||
|
|
@ -352,7 +348,7 @@ public class CriticalPathCalculator<T, D extends IDependency<T>> {
|
|||
Node<T, D> node = nodes.get(task);
|
||||
DependencyType dependencyType = getDependencyTypeEndStartByDefault(
|
||||
task, currentTask);
|
||||
Constraint<GanttDate> constraint = getDateEndConstraint(task);
|
||||
Constraint<GanttDate> constraint = getDateConstraints(task);
|
||||
|
||||
switch (dependencyType) {
|
||||
case START_START:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue