[Bug #763] Fix bug

The order of the forces applied varies depending on the constraints
having priority or not. This works because the weak forces only use
the constraints of the task and if you have constraints for one point
you don't have them for the other.

FEA: ItEr66S04BugFixing
This commit is contained in:
Óscar González Fernández 2010-12-21 19:01:44 +01:00
parent 7bcf3efe6c
commit 0d7761ef7a

View file

@ -1029,18 +1029,17 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
@SuppressWarnings("unchecked")
private List<Constraint<PositionRestrictions>> getConstraintsToApply() {
List<Constraint<PositionRestrictions>> result = new ArrayList<Constraint<PositionRestrictions>>();
if (!scheduleBackwards) {
result.addAll(asList(new WeakBackwardsForces(),
new DominatingForwardForces()));
Constraint<PositionRestrictions> weakForces = scheduleBackwards ? new WeakForwardForces()
: new WeakBackwardsForces();
Constraint<PositionRestrictions> dominatingForces = scheduleBackwards ? new DominatingBackwardForces()
: new DominatingForwardForces();
if (dependenciesConstraintsHavePriority) {
return asList(weakForces, dominatingForces);
} else {
result.addAll(asList(new WeakForwardForces(),
new DominatingBackwardForces()));
return asList(weakForces, dominatingForces, weakForces);
}
return result;
}
abstract class PositionRestrictions {
abstract List<Constraint<GanttDate>> getStartConstraints();