Writing Custom Job Release Rules

Job release rules on the Shop Floor Control Parameters form determine the sequence of scheduling for jobs with the same release date and time.
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 Scheduling Customization Guide, available for download from the Support web site.

Naming the Function

Your custom function can have any name that is not a standard user-callable function name.

Arguments

Summary


#include "factor.h"
double myrule(op)
ORDER  *op;  /* pointer to the job. */

This function must accept a job (Type: ORDER*) as its only argument.

Return Value

The function should return the ranking value of the job (Type: double).


double orrl (ORDER *op)
/*-----------------------------------------------------------------
     Ranking function to cause new jobs to be ranked on a high-to-low priority.
     ARGS:
       op - pointer to job for which to evaluate ranking rule
     RETURNS: job-ranking value
-----------------------------------------------------------------*/
{
     return((double) -op->orprio);
}

Installing the Custom Function

To make your custom job release function available to the Scheduler, you must "install" it from the initialization function ucini1 by calling the function sedfok. The function sedfok has two arguments:

  1. The number of the job release rule for which your release function contains custom logic.
  2. The address of your job release function.

For example, to install the above example rule "orrl" in rule position 39:


sedfok (39, orrl);