Writing Custom Job Release Rules

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).

Job release rules determine the sequence of scheduling for jobs with the same release date and time.

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).

Example

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);

Related Topics

Compiling and Linking Custom Scheduler Rules

Current Operations

Custom Planner Rule, Current Operations

Using Scheduler Rules

Writing a Custom Scheduler Rule