Writing Custom Batch 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 Scheduling Customization Guide, available for download from our Support site.

The Scheduler uses batch release rules to define the quantity that arriving jobs add to batches that are forming. This rule is sometimes also referred to as a batch quantity rule.

Batch Release Rule Logic

Before you create custom batch release rules and write the corresponding batch release functions, you should understand the logic used by the batch release function. When a job arrives at an operation with a batch definition specified, the batch release function is called.

When the batch release function is called, it determines what quantity is added to the forming batch, which in turn determines when the forming batch will be released.

Naming the Function

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

Arguments

#include "factor.h"
double brrl(ldp, batch)
LOAD *ldp;        /* pointer to the load */
BATCHDEF *batch;  /* pointer to the batch definition */

The function accepts two arguments, a pointer to load (Type: LOAD *) and a pointer to the batch (Type: BATCHDEF *).

Return Value

The function returns a value to be added to the forming batch (Type: double).

Here is an example of a batch elease function based on quantity in job:

double brrl (LOAD *ldp, BATCHDEF *batch)
/*-----------------------------------------------------------------
     Batch release rule which adds the quantity on the job.
     ARGS:
       ldp - pointer to the arriving load (job)
       batch - pointer to the batch that this load will follow
                RETURNS: job quantity
-----------------------------------------------------------------*/
{
     
     return((double)ldp->losize);
{

Installing the Custom Function

To make your custom release function available to the Scheduler, you must "install" it from ucini1 by calling the function sedfbq. This function has two arguments in the following order:

  • The number of the batch release rule for which your function contains custom logic.
  • The address of your batch release function.

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

sedfbq (39, brrl);
Related topics