Resource sequencing rules (global sequencing rule)

Request queue sequencing rules are used to order queues of requests for resources as loads place the requests. To carry out this ordering, the logic of each sequencing rule is written into a load ranking function. For this reason, sequencing rules are often called load ranking rules. A load is often the job, but could be a subset of the job if offsetting or splitting is currently invoked or could be several jobs batched together. You can write and install custom load ranking functions to sequence queues by rules that are specific to your manufacturing operation.

Before creating your own load ranking functions, you should understand how requests are processed by the request queue sequencing rule. When a request is placed by a load, the request is given a ranking value by the load ranking function. The ranking value never changes. For example, suppose a sequencing rule ranks requests based on the time remaining until due date. At 1 p.m. today a load with a due date at 4 p.m. today places a request and is given a ranking value of 3. At 3 p.m. today, a load with due date at 5 p.m. today places a request and receives a ranking value of 2. Assume that these are the only requests in the queue. Suppose that one of these requests is satisfied at 3:30. The request that is satisfied is the one with ranking value of 2, even though it has 1.5 hours until it is due and the request with ranking value 3 has only 0.5 hour until it is due.

Requests are ranked in the internal list representing the queue from low to high based on the ranking value. You can reverse this order in your tailored logic by multiplying the ranking value by –1. For example, to rank loads based on a longest processing time for a current operation, a ranking function would return the negative of the processing time for the load at its current operation.

Your customized sequencing function can have any name that is not the name of a standard system function. It must accept two arguments in the following order:

  1. A load (Type: LOAD*).
  2. An attribute (Type: ATTRIBUTE).

It must return a value (Type: double) which is the ranking value of the load’s request. Here is an example of a sequencing function to order loads based on least dynamic slack:


double sqrl (LOAD *ldp, ATTRIBUTE *atr)
/*-----------------------------------------------------------------
 Ranking function to cause loads to be ranked on a least dynamic
 slack basis.

   ARGS:
    ldp - pointer to load for which to evaluate the ranking code

   RETURNS: load ranking value
-----------------------------------------------------------------*/
{
   double rt, lt;
   int rn;

   rt = sermot(ldp, &rn, &lt);
   return(ldp->loordp->ordudt - DATENOW - rt);
      }

To make your tailored load ranking function available to the Scheduler, you must “install” it from the first user-initialization function ucini1 by calling the function sedfrk. The function sedfrk has two arguments in the following order:

  1. The number of the sequencing rule for which your ranking function contains custom logic.
  2. The address of your load ranking function