op_dist_qwait_gg1_handle_create()
Abstract
Returns a handle for creating a G/G/1 estimation of background delays in a specific queue.
Syntax
op_dist_qwait_gg1_handle_create (est_start_time, est_job_work_proc, est_job _inter_arrvl_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.] |
est_job_inter_arrvl_proc |
Procedure |
callback function to estimate interarrival time for 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
if (lan_technology == LlmC_Shared_Lan)
{
bkg_util_shared_q_info_ptr->qwait_handle =
op_dist_qwait_gg1_handle_create (0.0,
oms_bkg_util_return_lognormal,
oms_bgutil_bkg_job_interarrival_compute,
oms_bkg_util_long_interval_return_work_in_q, 0.0, min_long_interval,
micro_sim_duration);
}
Details
A G/G/1 queue estimation refers to an estimation with three parameters, where G is the generic 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 three callback functions—two for the former mode, one for the latter 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 three 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
est_job_inter_arrvl_proc (void* inter_arrvl_proc_state, double est_job_arr,
double prev_job_arrival_time)
This procedure returns a double that is the interarrival time between the current job and the next job. The first argument is a user-defined state pointer. The second argument is the est_jobarr_rate argument passed into op_dist_qwait_est(). The third argument is a double specifying the arrival time of the previous job. (The procedure you specify may not need to use all these arguments to calculate the interarrival time.)
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
- Use the KP op_dist_qwait_mg1_handle_create() to obtain a handle for creating a M/G/1 estimation