NOTE: See Writing a Custom Scheduler Rule for a summary of the steps required to create custom rules. For more details about the functions described in this topic, see the Simulation Tailoring Support Function Reference (available for download from the Support web site, on the documentation page for the Infor APS Virtual Planning/Simulation product).
To rank request queues, the logic of each sequencing rule is written into a load-ranking function. You can write and install tailored 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 sequence rule. When a load places a request, the load-ranking function gives the request a ranking value. 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 custom 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 custom load-ranking function can have any name that is not a standard user-callable function name.
#include "factor.h" double myrule(ldp, atrib) LOAD *ldp; /* pointer to the load. */ ATTRIBUTE *atr; /* pointer to attribute, if any, to base ranking on. */
The function must accept two arguments in the following order:
The function must return a value (Type: double) which is the ranking value of the load's request.
Here is an example of a load-ranking function to order loads based on least dynamic slack (that is, the least remaining time to due date minus the remaining processing time):
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, <); return(ldp->loordp->ordudt - DATENOW - rt); }
To make your custom function available to the Scheduler, you must "install" it from the initialization function ucini1 by calling the function sedfrk. Sedfrk has two arguments in the following order:
For example, to install the above example rule "sqrl" in rule position 39:
sedfrk (39, sqrl);
Compiling and Linking Custom Scheduler Rules