op_dist_qwait_mg1_handle_create()
Abstract
Returns a handle for creating a M/G/1 estimation of background delays in a specific queue.
Syntax
op_dist_qwait_mg1_handle_create (est_start_time, est_job_work_proc, long_intrvl_work_proc, pre_existing_work, long_intrvl_ia_num, long_intrvl_single_job_num)
| Argument | Type | Description |
|---|---|---|
est_start_time |
double |
time at which the queue begins processing work [Typically, this time is set to 0 to reflect the beginning of the simulation. See the Details section for a definition of “work”.] |
est_job_work_proc |
Procedure |
callback function to estimate delay for single jobs [See the Details section for the procedure’s prototype.] |
long_intrvl_work_proc |
Procedure |
callback function to estimate delay for intervals [See the Details section for the procedure’s prototype.] |
pre_existing_work |
double |
amount of work in the queue at the est_start_time [See the Details section for a definition of work.] |
long_intrvl_ia_num |
int |
timing factor [When the number of seconds between explicitly modeled jobs exceeds this timing factor times the mean estimation interarrival time, estimation of queueing delays switches from a per job basis to an interval basis.] |
long_intrvl_single_job_num |
int |
timing factor [When estimating delay on an interval basis, use this factor to determine when to switch back to per job estimation. The switch occurs when the estimation interval’s end time is within this timing factor times the mean estimation job interarrival time.] |
Return Type
Qwait_Handle
Queue estimation handle that can be used to call the KP op_dist_qwait_est().
Example
/* Create qwait handle */
bgutil_routed_state_ptr->qwait_handle = op_dist_qwait_mg1_handle_create (0.0,
oms_bgutil_single_job_work_constant, oms_bgutil_long_interval_work_in_queue,
0.0, 150, 100);
Details
An M/G/1 queue estimation refers to estimation with three parameters, where M is the exponential interarrival time, G is the general job size, and 1 refers to one server for one queue. There are two possible modes for estimating queueing delays: per job estimation and interval estimation. This KP specifies two callback functions, one for each mode. A job is one or more associated packets that a queue must process. Work is the number of seconds required to clear the queue.
The two callback functions have the following prototypes:
double
est_job_work_proc (void* job_work_proc_state, double start_service_time)
The procedure returns a double that is the number of seconds required to process the job. The first argument above is a pointer to an arbitrary state pointer that you specify when calling op_dist_qwait_est(). The second argument is the time at which the queue begins processing the job.
double
long_intrvl_work_proc (void* job_work_proc_state, double start_time,
double end_time, double work_in_queue)
The procedure returns a double that represents the amount of work in the queue at the end of the specified interval. The first argument above is a pointer to an arbitrary state pointer. The second argument is the simulation time at the beginning of the estimation interval, and the third argument is the simulation time at the end of the estimation interval. The final argument is the amount of the work in the queue at the beginning of the estimation interval.
Purpose
Provides a mechanism for establishing a handle to be used when estimating background delays in a queue. The handle specifies callback functions to be used for the actual estimation and parameters that govern the use of those callback functions.
Errors
- Recoverable Error: Illegal negative argument est_start_time (
<time>). - Recoverable Error: Illegal negative argument pre_existing_work (
<work>). - Recoverable Error: Illegal negative argument long_interval_ia_num (
<interval>). - Recoverable Error: Illegal negative argument long_interval_single_job_num (
<job>).
Reference
- Use the KP op_dist_qwait_estimate() to estimate background work in a queue for an interval
- Use the KP op_dist_qwait_gg1_handle_create() to obtain a handle for creating a G/G/1 estimation