Scheduling optimizer5890134Abstract A schedule optimizing algorithm improves scheduling quality, reducing a schedules cycle time and requiring only marginal increase in computer execution time. Lower quality computerized scheduling programs are substantially improved through the additional steps of sequential left time shifting and right time shifting of respective chronologically sorted completion time and starting time task listings. Claims What is claimed is: Description FIELD OF THE INVENTION
______________________________________
(1) Task A S1, C1, D1, R1, P1, I1
(2) Task B S2, C2, D2, R2, P2, I2
. . .
(N) Task n Sn, Cn, Dn, Rn, Pn, In
______________________________________
in which S is the start time, C is the completion time, D is the duration, R is the resource information, P is the precedence information and I is the identification of the task. That schedule is typically displayed on the computer's monitor, 8 in FIG. 4, and/or the associated printer 10 prints out the information. From among the multiplicity of tasks in the project, the formulated schedule contains a task that begins no earlier than any other task in the project, the earliest start time. The schedule also contains another task that ends no later than any other task in the project, the latest completion time. The difference between those two times defines the cycle time for the project. Whatever the choice made for the basic scheduling program, it is assumed that the program produced has a "good" cycle time, one that appears reasonable, and that the scheduling program had a reasonable execution time; in other words it is a good quality program. Given a "good" cycle time, it is seen that the present improvement makes a better cycle time, thereby improving upon quality. It is briefly noted that the foregoing is the state achieved by existing scheduling programs. There is no way of determining how "good" a schedule was achieved, unless one is able to demonstrate that another schedule can be created in a reasonable time that has a shorter cycle time. The only methods for such demonstration are to either use another program to construct a schedule to see if another algorithm might produce a better schedule, or to reorder the input data to see if another order for processing the given tasks might produce a better schedule. In the next step the computer identifies the latest completion time for any of the tasks listed in schedule S1 and sets that completion time C, as the right boundary, Cc, which step is represented at block 5; and to identify the earliest start time for any of the listed tasks in that preliminary schedule and set that start time S as the left boundary Ss, which step is represented at block 7. In the foregoing steps, the boundaries are set automatically by the scheduling program. The boundaries may, alternatively, be manually set by the user. In that event, the program should come to a halt and output to the display the appropriate message for the operator, as example, "Please insert the desired time desired for the right boundary? Note that the latest completion time of any task is (completion time)". The operator then enters the desired completion time via the computer keyboard. Following, the program next requests information on the left boundary in like manner with display of a similar query and the operator enters the desired start time boundary. It is appreciated that the foregoing task listing S1 lists the tasks in no particular order, since such ordering is not required of a scheduling program and, hence, is not required by the known scheduling program upon which the present algorithms are imposed. Should by chance or design the prior scheduling program include such a feature, such as the scheduling programs earlier referred to, it is useful in the practice of the present invention, as next described. The program sorts the listed tasks in chronological order by completion time C, as represented by block 9, to produce a chronological listing by completion time, S2. It is appreciated that the tasks in this second list are the same in number, n, as in the first, but that the particular tasks listed in (a) above are not likely to be listed in the same order presented in the tentative schedule. Hence a different representation is given for the tasks in this sorted order. It should be understood, however, that each task in the first list, such as task B, finds a counterpart in the tasks of the second sorted list, Task AS as example, assuming only for purpose of illustration that the sort procedure reversed the positions of the first two tasks in the tentative schedule. The forgoing convention is used for each of the listings hereafter described. It is recognized that the previously described time boundary setting steps may be accomplished prior to or following the sorting step, since neither step is dependent upon the other in function or precedent. That is a matter of designer's choice. The algorithm next returns control and/or branches back, as variously termed to the main scheduling program to accomplish a shifting operation. Working in reverse chronological order in the chronological listing, starting with the last task in the list, that is, from the task with the latest completion time, each task is "right shifted" as much as is permissible to the right completion time boundary, as represented by block 11. That is, each task is unscheduled and rescheduled to start and finish as late as possible prior to or at the right time boundary, Cc, without violating any of the applicable constraints and requirements associated with the respective task. In making this shift and evaluating for resource conflicts, it is understood that the main scheduling program considers each task's duration, and, hence, the new start time as would be assigned to the respective task. The foregoing backward shifting is accomplished by use of the capability of the underlying scheduling program, which is required to have the ability to perform "backward mode" scheduling, that is, to schedule tasks to start and finish as late as possible, and also the ability to perform "forward mode" scheduling, that is to schedule tasks to start and finish as early as possible, such as the capability found in at least the COMPASS scheduling program and the Microsoft Project scheduling program. Each task is thus assigned a new completion time, C, and, based on the data respecting the duration required for the particular task, the task is assigned a new start time S. It should be noted that the "order" of the tasks in the "right shifted" task listing remains unchanged from the order in which those tasks appeared in the prior sort operation. However, the tasks may likely no longer be in chronological order as before, as a consequence of any reassignment of completion times. This task listing, S3, another temporary schedule of itself, may be represented as follows:
______________________________________
(1) Task AS W1 (S, C, D, R, P, I)
(2) Task BS W2 (S, C, D, R, P, I)
. . .
(3) Task nS Wn (S, C, D, R, P, I)
______________________________________
As those skilled in the art appreciate, the foregoing sort may also be accomplished by reversing the listing, an equivalent, by sorting the tentative task schedule in reverse chronological order by completion time and then selecting the first task in the list, which would then hold the latest completion date, and right shifting the first task in such listing for undergoing unscheduling and rescheduling, and continuing down through the task listing. There are two subsidiary methods of performing the foregoing rescheduling step which may be conveniently considered at this stage of the procedure, such as illustrated in the flow chart of FIG. 2 to which reference is made. One is to individually unschedule and reschedule each task, one by one, or, alternatively, unschedule all tasks and commence rescheduling with the last task in the completion time chronological order. In the first instance, the main scheduling program need deal with inserting one set of times, while the other task times remain fixed. In the latter the main scheduling program deals with the task data as raw, except for the order in which tasks are given reassigned times, which requires the scheduling program to run through a repeat "cycle time" to accomplish the result. Since the two sub-routines represent a slightly different situation for the main scheduling program, a slightly different schedule necessarily results when employing the latter subroutine in lieu of the former. As illustrated by block 21 in FIG. 2 all tasks in chronological list S2 are unscheduled; a selection is made of the task in the latest completion time position in the chronological list as at block 23. As represented at block 25, the main schedule program then processes that selected task and reschedules it to the latest completion time permissible consistent with any applicable resource constraints and, based on the duration of the task, assigns a new start time also consistent with any applicable resource restraints; and places the task in a memory location for a new list in the last place location in the list as at block 27. Checking to determine whether the processed task was the final task requiring completion as at decision block 29, and receiving a negative reply as at block 31, the main scheduling program next selects the task from the list that had the next to the latest completion time, as represented at block 33 and repeats, as at block 35, returning to the backward mode shifting, as at block 25, to process the task and assign the next task the latest available completion time, again consistent with any resource constraints. And the rescheduled task is entered in the next to last position in this new list. This process repeats, task by task, through the N tasks, until the decision at block 29 is affirmative, in which case the affirmative flag 37 pronounces the new revised list S3 complete as represented at block 39. In the alternative procedure represented in part by the dash block outlines in FIG. 2, the task in the listing having the latest completion time position is selected as represented at block 22; and that selected task is unscheduled as represented at block 24; is processed by the main program, as at block 25, in the backward mode to determine the latest available completion time consistent with any resource constraints and a like start time also consistent with those constraints, which references as needed the various times still assigned to the other tasks whose start and completion times were not yet unscheduled, placing the task entry in the last position in a new list, as at block 27. As in the prior technique the program passes through the decisional block 29, the negative decision at 31 and the selection of the task in the listing having the next-to-last completion time position, as represented at block 33 and repeats at 35, processing this next task as at block 35 to right shift the task to the then latest available completion time as-close as permissible to the completion time boundary Cc consistent with resource restraints, and assigns a new start time also consistent with resource constraints. This procedure continues, consecutively filling the new list, bottom to top, until an affirmative decision 37 occurs at block 37, indicating that all of the N tasks in the listing have been processed in the foregoing way and the program arrives at the revised listing S3 as at block 39. Returning to the flow chart of FIG. 1 and continuing with the new algorithms, the various tasks listed in the "right shifted" task listing or temporary listing, S3, are again sorted, this time into chronological order by the respective start times, S to obtain another chronological listing, S4, represented in block 13. The first task in the listing S4 contains the earliest start time, S, and the last or "nth" task in the listing contains the latest start time. This sorted listing, S4, which in itself is a schedule, may be represented as follows:
______________________________________
(1) Task AT X1 (S, C, D, R, P, I)
(2) Task BT X2 (S, C, D, R, P, I)
. . .
(N) Task nT Xn (S, C, D, R, P, I)
______________________________________
Next, working in order in the list starting with the first task in the list, that is, with the task having the earliest start time, each task is "left shifted" as much as possible toward the start time boundary. That is, each task is unscheduled and rescheduled to occur at or as early as possible, but no earlier than the left or start time boundary or shortly thereafter, as desired, without violating any of the applicable constraints and requirements associated with the respective task. Thus each task is given a new start time, S, and, based on the data respecting the duration required for the particular task, the task is assigned a new completion time C. This creates a new listing, the "left shifted" task listing or schedule S5, represented in block 15, in which the tasks are maintained in the order set in the prior chronological listing. This additional listing S5, which in itself is a schedule, is the schedule which is accepted by the program as the optimized schedule, and is represented as follows:
______________________________________
(1) Task AU Y1 (S, C, D, R, P, I)
(2) Task BU Y2 (S, C, D, R, P, I)
. . .
(N) Task nU Yn (S, C, D, R, P, I)
______________________________________
As in the case of the right shifting, the left shifting of the tasks to the selected start time boundary may be accomplished in either of two subsidiary methods which are illustrated in FIG. 3, to which reference is made. As illustrated by block 41 in FIG. 3 all tasks in chronological list S4 are unscheduled; a selection is made of the task in the earliest start time position in the chronological list as at block 43. As represented at block 45, the main scheduling program then processes that task and reschedules it to the earliest start time permissible consistent with any applicable resource constraints and, based on the duration of the task, assigns a new completion time also consistent with any applicable resource constraints; and places the task data in a memory location for another new list, as represented at block 47, in the first place location in the list. Checking to determine whether the processed task was the final task requiring completion as at decision block 49, and receiving a negative as at block 51, the main scheduling program next selects the task from the list that had the next to the earliest start time, as represented at block 53 and repeats 55, returning to the forward mode shifting, as at block 45 to process the task and assign the next task the earliest permissible start time, again consistent with any resource constraints; and places the rescheduled left shift task in the next to the first position in the new list S5. This process repeats, task by task, consecutively filling the lower slots in the new list, until the decision at block 49 is affirmative, in which case an affirmative flag 57 pronounces the new revised list S5 complete as represented at block 59. In the alternative procedure represented in part by the dash block outlines in FIG. 3, the task in the listing having the earliest start time position is selected as represented at block 42; and that selected task is unscheduled as represented at block 44; that task is then processed by the main program in the forward mode, as represented at block 45, to determine the earliest start time consistent with any resource restraints and a like completion time also consistent with those restraints. In so doing the main scheduling program references as needed the various times still assigned to the other tasks whose start and completion times have not been unscheduled, placing the task entry in the first position in a new list, as at block 59. As in the prior technique the program passes through the decisional block 49, the negative decision at 51 and the selection of the task in the listing having the next-to-first start time position, as represented at block 53 and repeats as at block 55, processing this next task as at block 45 to left shift the task to the then earliest permissible start time as close as permissible to and no later than the start time boundary Ss consistent with resource restraints, and assigns a completion time also consistent with resource constraints. This procedure continues until an affirmative decision occurs as at block 57, indicating that all of the tasks in the listing have been processed in the foregoing way and arrives at the revised listing S5 as at block 59. Returning to FIG. 1, the new schedule S5 is the final step in the schedule optimization routine. The main schedule program then stores the schedule in memory, and overwrites or erases each of the original schedule and any intervening schedules as may have been produced and temporarily stored during the run of the scheduling program, which are not illustrated. As additional steps to permit use of the schedule, the schedule is displayed on the computer's display device as represented at block 17, such as the associated computer monitor 8 and/or is printed out by the associated printer 10 represented in FIG. 4. The optimizing program produces schedules of enhanced quality, that is, of lesser cycle time with at most a doubling of the execution time of the principal scheduling program. In one example, a schedule derived by the COMPASS scheduling program for performing a complex manufacturing project required 53 days for completion of the project. By subjecting that schedule to the additional algorithms presented in this specification, in just one run of the improved program, the schedule derived for the project required only 40 days for completion, a saving of 17 days time or 30%. Since the days saved represents considerable manufacturing overhead and money, the advantage and benefit of the improvement is apparent. In general, applicant believes, that the modification should serve to improve all hueristic scheduling programs, moreso those scheduling programs that are regarded of poor quality and less so for those that are of higher quality. However, it is possible for a poor quality scheduling program to be modified to achieve the same quality as a higher quality program, but requires substantially less execution time to formulate the schedule. Better quality schedules can often be produced by performing multiple repetitions of the basic right shift and left shift algorithm. Since this algorithm is designed to take an existing schedule, and by packing left and right, improve it, one is permitted to take the result of a first application of the algorithm as the input to a second application of the algorithm, and take the output of a second iteration and use it as the input to a third iteration, and so on. Generally, no further improvement is found after just two or three iterations of the described procedure. The foregoing algorithm can be used to improve a selected time frame within a schedule by setting the left and right time boundaries accordingly. As example, if one has a schedule for four weeks worth of work, and desires to be able to accommodate some additional work in the second week without perturbing the schedule for the first, third, or fourth week, one can set the left boundary to be the start time of the second week and the right boundary to be the end time of the second week and apply the shift right/left operations. If the schedule has not been previously packed, it should reduce the cycle time for the work scheduled in the second week, leaving room in the schedule to accommodate a small amount of additional work, perhaps ten to twenty per cent more, depending upon the quality of the initial schedule. The algorithm thus is used to open up a "hole" at a designated point in an existing schedule. The algorithm can be used to open up a "hole" at a designated point in an existing schedule by applying the algorithm first with the left boundary set at the beginning of the schedule and the right boundary set at the designated point. Then only the right shift phase of the algorithm is applied with the left boundary set at the designated point and the right boundary set at the end of the schedule. Instead of just shifting left and right within a given week, as in the preceding example, one might choose to shift right everything from Wednesday of the second week through the end of the third week, and then shift left everything from the beginning of the first week through Wednesday of the second week in order to open up as much capacity in the middle of the second week as is possible. This allows one to clear a space in the work calendar to be able to accommodate an anticipated rush order that will be ready for handling at that time. The algorithm can be used to improve the cycle time for a subset of the tasks on a schedule by setting the left and right boundaries accordingly and then applying the shifting operations only to the selected activities. As example, if a given schedule includes the production of several aircraft all at the same time, which are in various stages of completion, one may desire to accelerate the completion of one aircraft, while leaving the others approximately as they are. To do so, one sets the left boundary to be the scheduled start time of the selected aircraft and set the right boundary to be the scheduled finish time of the selected aircraft and apply the described shift right/left operations to ONLY the steps of the selected aircraft, leaving the steps associated with the other aircraft unchanged, then the scheduling for the selected aircraft will be able to take advantage of any excess capacity within exactly that time frame. As another more interesting example, if given two aircraft being constructed according to a given schedule with interleaved operations, one may select the aircraft with the lower priority and shift its operations right, towards its completion time, and then select the high priority aircraft and shift its operations towards its start time. Then, in order to exploit any excess capacity that might remain, the full shift right/shift left procedure is performed only for tasks associated with the high priority aircraft. Again the results obtained depend largely upon the quality of the original schedule that is input to the algorithms. If one starts with a high quality schedule, the amount of movement obtained, that is, quality improvement, is small. If the underlying scheduling program contains the ability to sort by additional or secondary keys, additional useful variations of the described algorithm are possible; and it is also useful if the scheduling program provides the ability, as an option, to schedule, unschedule and reschedule individual activities. As example, if one computes the slack time for each activity in a given schedule, as hereafter described, and then sorts by two keys before the right pass, first, sorting by slack time from least to greatest, and then sorting by completion time from last to first, then if two tasks complete at the same time, the one with the least slack time will be shifted first. If one applies this additional sort key on both right and left passes, one obtains greater schedule improvement than when just sorting by completion and start times. The reason for this is that jobs with less slack time are more critical. By giving those jobs priority in the shifting process, they tend to shift into better locations on the schedule. Since they are the critical jobs they have more influence over the resulting cycle time. The best way to determine the slack time associated with a task is to perform the schedule pack algorithm twice. The first time squeezes out the majority of the excess cycle time. Then during the second pack, if one carefully records how much a task moves during the left shift phase one obtains a very clear measure of slack time. Remember the task was shifted as far right as possible and then on the left pass, shifted as far left as possible. Anything that is truly critical will not move. Other tasks will move either a little or a lot. Although the last described features are desirable for the underlying scheduling program, it is recognized that the foregoing options are not required for implementation of the basic algorithm. Although the present application adopts the terminology of tasks and project, other terminology may be used without departing from the invention. As example others may refer to tasks as "activities" and to the project as the "task"; still others may refer to the tasks as "nodes" and to the project as a "principal node". Notwithstanding the choice of terminology employed, the steps in the described algorithm, by whatever name, remains as "sweet". The underlying theory to the shifting procedure is recognized as being intuitive. In general, the first tasks placed on a schedule benefit from the flexibility in their choice of time and resources. Tasks placed on the schedule later in the scheduling process are left with only the times and resources that earlier activities did not use. The sort procedures combined with the right and left phases, is believed to implicitly give higher priority to the right activities, while constructing the right shift and left shift schedules. When a schedule is built in the forward direction every task is scheduled to start and finish as early as possible. Because of that, critical activities in the left part of the schedule are crowded together with many other non-critical activities. But the right most activities on the schedule are found in that part of the schedule, because they follow critical activities in the left part of the schedule, and most are themselves critical. In the right shift phase, these right-most critical activities are effectively given first priority in building the new right-shifted schedule. By similar analysis, the left-most activities in the right-shifted schedule are critical activities with little slack time and they are given first priority in the left shift phase. Between the two passes, the present algorithm gives first priority to the placement of critical activities at the right and then the left ends of the schedule, while allowing non-critical activities to shift freely in between. The foregoing also allows one to understand why using the additional sort key of slack time generally improves the performance of the algorithm. The foregoing algorithms are seen to define a novel method for optimizing an existing computer assisted scheduling program. When permanently integrated within the source code of an existing computer assisted scheduling program a new and improved scheduling program is seen to result. The invention therefore may be seen also as a new scheduling program. The physical data defining that program may be carried upon a floppy disk or other computer peripheral memory device through which the method may be installed upon a programmable digital computer. In that sense the invention is also a program element. With the invention installed within a computer, either a general purpose computer in which the algorithms are installed from a program element, commonly referred to as software, or a special purpose computer dedicated to scheduling in which the algorithms are permanently installed within a read only memory, in that sense the invention is also a computer apparatus that performs the algorithm. All of the foregoing arrangements thus fall within the scope of my invention. In the foregoing description, the word "time" was used to indicate either a starting point, such as start time, and/or an ending point in a schedule, such as completion time. On a calendar schedule that time would likely be expressed in terms of a calendar date and an hour or in terms of a number of twenty four hour periods following an arbitrary start date and hours, which renders the display of a schedule more easily understood by the operator. However, to minimize complication to this description, the convention used is to simply designate those dates and hours solely by the word "time". The foregoing invention has been demonstrated as successful, having been embodied within a computer program and applied. An unpublished source code listing for that program, authored by the applicant, copyrighted by the McDonnell Douglas Corporation, written in the ADA language, accompanies this application in an Appendix hereto. That source code listing illustrates programming details of the described algorithm for implementation as an enhancement within the copyrighted COMPASS scheduling program. That source code listing is not available for publication or reproduction. While, it is appreciated that the foregoing description is sufficient in detail to enable one skilled in the art to make and use the invention, such unpublished source code listing may be inspected in the file of this application by those who wish to acquaint themselves with a specific example of a code listing that incorporates the described invention. While a preferred embodiment has been illustrated and described herein, it will be obvious that numerous modifications, changes, variations, substitutions and equivalents, in whole or in part, will now occur to those skilled in the art without departing from the spirit and scope contemplated by the invention. Accordingly, it is intended that the invention herein be limited only by the scope of the appended claims.
__________________________________________________________________________
APPENDIX
COPYRIGHT (UNPUBLISHED)- MCDONNELL DOUGLAS CORP.
Schedule Pack Source Program
PROCEDURE schedule.sub.-- pack (Activitylist : IN OUT Activity.sub.--
List.Typeactivitylist;
Resourcelist : IN OUT Resource.sub.-- List.Typeresourcelist;
Conditionlist : IN OUT Condition.sub.-- List.Typeconditionlist) is
minimum.sub.-- start.sub.-- time: time.typetime := time.positive.sub.--
infinity;
maximum.sub.-- finish.sub.-- time: time.typetime := time.negative.sub.--
infinity;
scheduling.sub.-- window: interval.typeinterval;
forward.sub.-- mode : mode.typemode := mode.strict.sub.-- forward.sub.--
mode;
backward.sub.-- mode : mode.typemode := mode.strict.sub.-- backward.sub.--
mode;
workingactivitylist: activity.sub.-- list.typeactivitylist;
workingresourcelist: resource.sub.-- list.typeresourcelist;
workingconditionlist: condition.sub.-- list.typeconditionlist;
localactivitylist: activity.sub.-- list.typeactivitylist;
localresourcelist: resource.sub.-- list.typeresourcelist;
localconditionlist: condition.sub.-- list.typeconditionlist;
localactivity: activity.typeactivity;
localstart : time.typetime;
localfinish : time.typetime;
temp.sub.-- activity.sub.-- list: activity.sub.-- list.typeactivitylist;
begin
workingactivitylist := activitylist;
workingresourcelist := resourcelist;
workingconditionlist := conditionlist;
localactivitylist := activitylist;
localresourcelist := resourcelist;
localconditionlist := conditionlist;
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,"******************Optimizing Schedule*");
abstract.sub.-- io.write.sub.-- newline(low.sub.-- level.sub.-- io.standar
d.sub.-- output.sub.-- file);
minimum.sub.-- start.sub.-- time := interface.accept.sub.-- time("Left
Boundary for Packing Operation");
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,"Scanning Schedule for Right
Boundary");
abstract.sub.-- io.write.sub.-- newline(low.sub.-- level.sub.-- io.standar
d.sub.-- output.sub.-- file);
just a reminder that we need to change both sp and ccp to work on just
selected
activities
Qualified.sub.-- Name. Prefix (resource.sub.-- name, Resource.sub.--
Profile.Qualifiedname.sub.-- Of
(Localresourceprofile) while not activity.sub.-- list.nilp
(localactivitylist) loop
localactivity := activity.sub.-- list.first(localactivitylist);
if activity.assigned.sub.-- of(localactivity)then
localfinish := activity.assigned.sub.-- finish.sub.-- of(localactivity)
iflocalfinish>maximum.sub.-- finish.sub.-- time then
maximum.sub.-- finish.sub.-- time := localfinish;
end if;
end if;
localactivitylist := activity.sub.-- list.rest(localactivitylist); end
loop;
scheduling.sub.-- window := interval.make(minimum.sub.-- start.sub.--
time,maximum.sub.-- finish.sub.-- time);
first pack to the right, within the current bounds
interface.display.sub.-- message ("note", "sorting by status
= completed");-- completed at the
bottom
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File,"sorting by status =
complete");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
temp.sub.-- activity.sub.-- list := Sort.sub.-- Commands.Sort.sub.--
By.sub.-- status
(workingActivityList,completed.sub.-- id);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list
interface.display.sub.-- message ("note", "sorting by precedence");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting by precedence");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
temp.sub.-- activity.sub.-- list := Sort.sub.-- Commands.Sort.sub.--
By.sub.-- Predecessors (workingActivityList);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list;
interface.display.sub.-- message ("note", "sorting by assigned finish
time");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting by assigned
finish time");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
temp.sub.-- activity.sub.-- list:= Sort.sub.-- Commands. Sort.sub.--
By.sub.-- Assigned.sub.-- Finish.sub.-- time
(workingActivityList);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list;
interface. display.sub.-- message ("note", "sorting into reverse
order");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting into reverse
order");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
temp.sub.-- activity.sub.-- list := Sort.sub.-- Commands.Reverse.sub.--
order (workingActivityList);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list;
interface.display.sub.-- message ("note", "sort for right pass
complete");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sort for right pass
complete");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
localactivitylist := workingactivitylist;
Interface.Display.sub.-- Activity.sub.-- List(workingActivitylist);
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file, "packing right");
while not activity.sub.-- list.nilp (localactivitylist) loop
localactivity := activity.sub.-- list.first(localactivitylist);
if activity.assigned.sub.-- of(localactivity) and then
(id. equal(activity.status.sub.-- of(localactivity),completed.sub.-- id)
or
id.equal(activity.status.sub.-- of(localactivity),inwork.sub.-- id) or
id.equal(activity.status.sub.-- of(localactivity),pending.sub.-- id)) and
then time.">"
(activity.assigned.sub.-- finish.sub.-- of(localactivity), minimum.sub.--
start.sub.-- time) then localstart :=
activity. assiqned.sub.-- start.sub.-- of (localactivity);
-time.write.sub.-- dshm
(low.sub.-- level.sub.-- io.standard.sub.-- output.sub.-- file,activity.as
signed.sub.-- start.sub.-- of(localactivity));
scheduling.sub.-- primitives.Unschedule
(localactivity,workingactivitylist,workingresourcelist);
scheduling.sub.-- primitives.schedule
(localactivity,workingactivitylist,workingresourcelistsworkingconditionlis
t,
scheduling.sub.-- window, backward.sub.-- mode);
if activity.assigned.sub.-- of(localactivity) then
if time."=" (activity.assigned.sub.-- start.sub.-- of(localactivity),
localstart ) then
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,"=");
elsif time. ">" (activity.assigned.sub.-- start.sub.-- of(localactivity),
localstart ) then
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,">");
elsif time."<" (activity.assigned.sub.-- start.sub.-- of(localactivity),
localstart ) then
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,"<");
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,"warning, failed to pack on
right pass");
Qualified.sub.-- name.write(low.sub.-- level.sub.-- io.standard.sub.--
output.sub.-- fileXactivity.qualifiedname.sub.-- of
(localactivity)); abstract.sub.-- io.write.sub.-- string(low.sub.--
level.sub.-- io.standard.sub.-- output.sub.-- file,"Old Time:");
time.write.sub.-- dshm (low.sub.-- level.sub.-- io.standard.sub.--
output.sub.-- file,localstart);
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file,"New Time:");
time.write.sub.-- dshm
(low.sub.-- level.sub.-- io.standard.sub.-- output.sub.-- file,activity.as
signed.sub.-- start.sub.-- of(localactivity));
abstract.sub.-- io.write.sub.-- newline(low.sub.-- level.sub.-- io.standar
d.sub.-- output.sub.-- file);
end if;
else
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standa
rd.sub.-- output.sub.-- file, "failed to reschedule on
right pass");
Qualified.sub.-- name.write(low.sub.-- level.sub.-- io.standard.sub.--
output.sub.-- fileRactivity.qualifiedname.sub.-- of
(localactivity)), abstract.sub.-- io.write.sub.-- string(low.sub.--
level.sub.-- io.standard.sub.-- output.sub.-- file,"Old
Time:"); time.write.sub.-- dshm (low.sub.-- level.sub.-- io.standard.sub
.-- output.sub.-- file, localstart);
abstract.sub.-- io. write.sub.-- newline(low.sub.-- level.sub.--
io.standard.sub.-- output.sub.-- file);
end if;
end if; localactivitylist := activity.sub.-- list.rest(localactivitylist);
end loop;
then see which ones pack back to the left
interface.display.sub.-- message ("note", "sorting by status
= completed");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting by status =
completed");
Abstract lo.Write Newline (Low.sub.-- Level.sub.-- lo.Standard.sub.--
Output.sub.-- File);
temp.sub.-- activity.sub.-- list := Sort.sub.-- Commands.Sort.sub.--
By.sub.-- status
(workingActivityList,completed.sub.-- id);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list;
interface.display.sub.-- message ("note", "sorting into reverse order");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting into reverse
order");
Abstract lo.Write Newline (Low.sub.-- Level.sub.-- lo.Standard.sub.--
Output.sub.-- File);
temp.sub.-- activity.sub.-- list:= Sort.sub.-- Commands.Reverse.sub.--
order (workingActivityList);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list;
interface.display.sub.-- message ("note", "sorting by predecence");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting by predecence");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
temp.sub.-- activity.sub.-- list := Sort.sub.-- Commands.Sort.sub.--
By.sub.-- Predecessors (workingActivityList);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workingactivitylist := temp.sub.-- activity.sub.-- list;
interface.display.sub.-- message ("note", "sorting by assigned start
time");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sorting by assigned start
time");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
temp.sub.-- activity.sub.-- list := Sort.sub.-- Commands.Sort.sub.--
By.sub.-- Assigned.sub.-- start.sub.-- time
(workingActivityList);
activity.sub.-- list.shallow.sub.-- collect(workingactivitylist);
workinqactivitylist := temp.sub.-- activity.sub.-- list;
interface.display.sub.-- message ("note", "sort for left pass
complete");
Abstract.sub.-- lo.Write.sub.-- String (Low.sub.-- Level.sub.-- lo.Standar
d.sub.-- Output.sub.-- File, "sort for left pass
complete");
Abstract.sub.-- lo.Write.sub.-- Newline (Low.sub.-- Level.sub.-- lo.Standa
rd.sub.-- Output.sub.-- File);
localactivitylist := workingactivitylist;
Interface. Display.sub.-- Activity.sub.-- List(workingActivitylist);
abstract.sub.-- io.write.sub.-- string(low.sub.-- level.sub.-- io.standard
.sub.-- output.sub.-- file, "packing left");
abstract.sub.-- io.write.sub.-- newline(low.sub.-- level.sub.-- io.standar
d.sub.-- output.sub.-- file);
while not activity.sub.-- list.nilp (localactivitylist) loop
local activity: = activity.sub.-- list.first (localactivity list);
if activity.assigned.sub.-- of(localactivity) and then
(id.equal(activity.status.sub.-- of(localactivity),completed.sub.-- id)
or
|
Same subclass Same class Consider this |
||||||||||
