Earliest time that the task may be started based on the tasks and events before it in the network. For example, if the task preceding this task takes 10 seconds, at the very least, the current task cannot start until 10 seconds after the project starts.
The
GetEarliestCompletionTime method of the TActivityNetwork component calculates and fills in the
Criticality,
EarliestStartTime and
LatestStartTime properties.
Namespace: ActivityNetwork
Delphi
|
published
property EarliestStartTime: Integer read FEarliestStartTime write FEarliestStartTime;
|
Property Value
Type: Integer
The following example calculates the earliest time the project can be completed. It displays the value in a listbox. It also fills in each task's earliest start time and latest desirable start time:
Delphi
|
var
i, j: Integer;
begin
if G is TActivityNetwork then
begin
TActivityNetwork(g).GetEarliestCompletionTime( G[0] as TAOEEvent, G[G.NodeCount-1] as TAOEEvent, ListBox3.Items, i );
ListBox3.Items.Clear;
ListBox3.Items.Add('Earliest Project Completion Time: '+ IntToStr( i ) );
ListBox3.Items.Add('Tasks and their earliest possible start time and' );
ListBox3.Items.Add('latest desirable start time' );
for i := 0 to G.NodeCount - 1 do
with G.Node[i] as TAOEEvent do
begin
for j := 0 to EdgeCount - 1 do
ListBox3.Items.Add((Edge[j] as TAOETask).Name +' : '+
IntToStr(TAOETask(Edge[j]).EarliestStartTime)+'/'+
IntToStr(TAOETask(Edge[j]).LatestStartTime) );
end;
end;
end;
|
|