Scheduler rules (run time) and setup time rules

Scheduler rules (Operation run time rules) and Setup Times Rules are used to determine the run/setup time for a load at a particular operation. Operation run/setup time functions can compute run/setup time based on the size of a load, the type of item the load represents, and other characteristics of a load. The run/setup time function can use the run/setup time entered on the operation and modify it as required by the run/setup time rule.

The run/setup time function is called under two circumstances:

  • When a load begins processing at an operation for the first time.
  • When an estimate of the run time for a load at a future operation is required, such as when computing dynamic slack.

The function is notified, through an argument, as to which of these situations apply. For many rules there will be no difference between the time calculations in either case. For rules which take into consideration the current situation at the operation such as setup, estimates are calculated differently. The run/setup time function is not called upon resuming a operation after a shift comes up. In this case, the run/setup time is the remainder of the previously computed run/setup time.

You can create custom operation run/setup time rules and their corresponding functions for your application. Your function can have any name that is not a standard system function name. It must accept three arguments in the following order:

  1. An estimate flag (Type: int) set to:
    • TRUE (non-zero) for estimate
    • FALSE (zero) otherwise
  2. A pointer to the load for which the estimate is being made, Type: LOAD*.
  3. A pointer to the operation for which the time is to be computed, Type: JOBSTEP*.
  4. An expression root, Type: void*.

Your function should return a value (Type: double), the total time for the operation in hours. Here is an example of a run time function to take a run time listed on a operation per piece that is entered on the operation:


double jsst (int est, LOAD *ldp, JOBSTEP *jsp, void *root)
/*-----------------------------------------------------------------
   Function to compute the run time for the given operation for
   a load using operation time code 1 (fixed time per part).

   ARGS:
    est - estimate flag
    ldp - pointer to load
    jsp - pointer to operation
    root - expression root
   RETURNS: the step time
-----------------------------------------------------------------*/
{
   double time;
   evalexp(root, 0, &time, 'R');
   return(time * ldp->losize);
}

To make your custom operation run time function available to the Scheduler, you must “install” it from the first user-initialization function ucini1 by calling the function jsdfst. The function jsdfst has two arguments in the following order:

  1. The number of the operation run time rule for which your function contains custom logic.
  2. The address of your operation run time function