Professional Documents
Culture Documents
...
greater than the current time. The rule is that a job will start
as soon as all jobs that it depends on have finished AND the
current time is greater than or equal to the earliest-start-time
of that job. That is, if i is the greatest finish time of the
jobs that the new job depends on, then the new job will start at
time i or its earliest-start-time, whichever is larger. For
example, if the current time is 3, and the earliest-start-time of
a job printing is 10, then printing can only start at time 10 or
later, depending on the precedence relations between printing and
other jobs. On the other hand, if the current time is 3 and the
earliest-start-time of printing is 1, then it may start at time 3
or later, depending on the precedence relations between printing
and other jobs.
There is NO LIMIT on the number of jobs that can run concurrently
in the system.
The next parameter <length> is an integer denoting the duration
of the new job. For example, if a job printing starts at time i
and its duration is 5, the finish time of printing is i + 5.
The job id critical is an exception and it does not denote a real
job.
Instead, upon seeing the job id critical, your program
should output a critical path in the current directed graph. In
this case, the input line contains nothing else after critical.
Recall
that
the
last
job
in a critical
path
has
the
greatest finish time among all existing jobs. If the directed
graph is empty at this moment, output nothing.
There may be several critical paths in the directed graph, and
your program can output any one of them. Your output critical
path must be printed in one output line in the following format.
<time>
<id>
<start>
<finish>
<id>
<start>
<finish>
...
[Note: See the given sample_output.txt to test your program with the
given jobs.txt input file]
The value <time> is the current time. The rest of the output line
contains one triple per job on the critical path. The left-to-right
order of the triples should be the execution order of the jobs on the
critical path.
The triples should be separated by blanks.In each
triple, <id> is the job id, <start> is the actual start time of the
job, and <finish>is the finish time of the job.
These three values
should be separated by blanks.
The id critical may appear multiple times in the file jobs.txt. Note
that when you see the id critical, there is no real job to be added to
the directed graph at the current time.
Due Date:
--------Friday August 21th, 2015 by 11:59:59 p.m.
This assignment is worth 12% of your final
semester.
Good Luck!
grade
in
DSA555
this