Skip to content

Design Document: Backward Scheduling

Dmitry Barashev edited this page Apr 9, 2018 · 2 revisions

Summary

This document provides a high-level specification of backward scheduling feature in GanttProject.

Currently GanttProject supports forward scheduling which assumes that project manager knows the project start date and builds a Gantt chart with the purpose to find out when the project will complete.

Backward scheduling is used when project manager has a deadline date by which the project must be completed and builds a Gantt chart with the purpose to find out the project start date. It is possible to emulate backward scheduling in GanttProject by using reversed Start-Finish dependencies instead of forward Finish-Start but it is pretty cumbersome process.

The goal of this project is to allow for backward scheduling without changing user habits in a flexible manner. We want to watch for deadlines being met and alert when they move offering to user a choice: whether to shift tasks backward or to change the deadline.

Basic Scenario

When user wants backward scheduling targeted at some deadline date, he creates a deadline task or milestone and draws a chain of tasks with regular Finish-Start dependencies which is ending with the deadline. The chain may and typically will move the deadline task beyond the deadline date. When GanttProject detects that deadline is not met, it shows firing alert indicator and opens alerts dialog on click. In the alert dialog user can take a decision about the unmet deadline. The decision is either move the deadline task and all predecessors backwards so that deadline was met or to set a new deadline date.

User Interface

This feature appears in the following places in the user interface:

  • New editable Deadline date field in the task properties, editable Deadline column in the task table.
  • Visual indicator of firing alerts.
  • Dialog showing the list of alerts and possible fixing actions.

Besides, deadline field should be exported to CSV/PDF/HTML and exported/imported to MS Project formats.

Key code components

Here is a list of major files/classes which may be touched by this feature implementation

Task Properties Dialog

net.sourceforge.ganttproject.gui.GanttTaskPropertiesBean is the central class of the properties dialog. It requires little changes: only adding a new date field in a way similar to neighbor start/end date fields and writing the picked date to the task properties.

Task Manager

  • net.sourceforge.ganttproject.task.TaskManager, net.sourceforge.ganttproject.task.TaskManagerImpl, net.sourceforge.ganttproject.task.TaskImpl are the key components of task management subsystem.
  • net.sourceforge.ganttproject.io.TaskSaver and net.sourceforge.ganttproject.parser.TaskTagHandler are responsible for persisting task information to XML and deserializing from XML.

This feature will require changing task interfaces and implementation to be able to persist deadline date. Those changes are going to be pretty easy though. Reporting unmet deadline is more challenging because it requires that every task where deadline is set immediaetly reported as soon as end date exceeds the deadline date.

There is support of listeners on task date changes, but for the purpose of this feature we may want to build such checks right into the internals of TaskImpl/TaskManagerImpl.

Alert Manager and pluggable alerts

In order to be able to show in the user interface the firing alerts indicator and list of alerts with possible fixes we need AlertManager API. Alert is a task + alert description + possible fixes. Fix is description + runnable action which takes task and makes appropriate changes.

Alert "Unmet deadline"

Implementation of alert "unmet deadline" should report tasks with end date > deadline date to the alert manager with possible fixes: move the deadline and reschedule predecessors backwards.

Moving the deadline is trivial while rescheduling is more challenging. Scheduler component is pretty complex and requries a lot of care. In short, scheduler works in two stages: first it builds a task graph where tasks are nodes and dependencies are edges and then traverses the graph adjusting node properties as necessary.

Perhaps the easiest way is to simulate backward scheduling using the same technique which can be employed in the current GanttProject by user: reverse dependencies and their types in a part of the task graph and run a regular scheduler. Such implementation will be not invasive because requires changes in task graph building and no changes in the scheduler code.

The key components of the task scheduler: net.sourceforge.ganttproject.task.algorithm.SchedulerImpl, net.sourceforge.ganttproject.task.algorithm.DependencyGraph

Milestones

The following is a list of milestones. Every milestone designates a completed piece of work. Code written by the end of milestone is expected to be tested and internationalized where it makes sense. After reaching the milestone we make a payment according to the payment plan

M1: deadline field

Expected functionality: user can set deadline date in task properties and this information is persisted in the project file, can be read from the project file.

M2: Alert Manager API

M3: Alert dialog UI

M4: Unmet deadline alert

M5: Export and import

Contribution Policy