# Cycle time of Single server queue with batching¶

Section 9.4 of Factory Physics presents an analysis of the (average) cycle time of single server queue with setups. This analysis is, for me at least, part confusing, partly wrong. In this note I make a slightly different model with the aim to repair some of the problems of the sequential batch model of FP and to unite my model with the transfer batch model of FP.

## The Model¶

Jobs arrive at an assembly point in which they are batched in lot sizes of \(k\) jobs. These batches are sent to queue. A server removes batches from the head of the queue, performs a setup and serves the individual jobs. Once a job is finished, it leaves the system. Thus, the total cycle time can be split up into four terms:

- Wait to batch time, i.e., time to complete the batch
- Time in the queue
- A wait in batch time, i.e., time a job waits to be served by the server
- Service/processing time

In the sequel I will derive a formula for the average total cycle time. The formula uses the following data of single jobs:

We assume that the interarrival times between jobs are independent and have the same distribution. Likewise, we assume that the processing times are independent and identically distributed. Finally, we assume that the setup time is constant. Note that it is easy to extend the derivation below to cases with stochastic setup times.

## Wait to Batch Time¶

As jobs arrive at an assembly point at which they are batched, jobs have to wait until the batch is complete. The first job has to wait for \(k-1\) other jobs before the batch is complete, the second for \(k-2\) jobs, and so on, until the last, \(k\)-th, job, which does not have to wait as it completes the batch. The total amount of waiting time is therefore

so that the average waiting time for a job becomes

## Average Queueing Time¶

Once a batch is compete, it is sent to a queue. The batch stays in the queue until it reaches the head of the queue. When the server becomes idle, it removes a batch from the queue. Thus, batches are queueing, not the individual jobs. As a consequence, the batches in the queue observe a processing time \(t_{e,b}\) of batches, not of single jobs, since the server removes batches from the queue, not single jobs. Moreover, batches arrive at the queue at a rate \(r_{a,b}\). Finally, to use the G/G/1 waiting time formula we need to derive expressions for the SCV \(c_{a,b}^2\) of the interarrival times of batches; we cannot directly use the SCV \(c_a^2\) of the jobs. Likewise, we need an expression for the SCV \(c_{e,b}^2\) of the processing time of a batch.

Let us write \(S_i\) for the interarrival time between jobs \(i-1\) and \(i\) in a batch. Thus, \(S_1\) is the interarrival time between the first job of a batch and the last job of the previous batch, \(S_2\) is the interarrival time between jobs 1 and 2, and so on. Thus, the interarrival time \(T_{a,b}\) between two batches can be written as

The average interarrival time of batches is therefore

since we assume that all interarrival times have the same distribution. Hence, the interarrival times of batches is \(r_{a,b} = 1/t_{a,b} = 1/kt_a= r_a/k\).

Next, we write \(T_i\) for the processing time of the \(i\)-th job in a batch. Therefore the average processing time of a batch is

since the processing times have the same distribution.

The utilization of the server must then be

With regard to the SCV of the interarrival times of the batches, we use the definition of the squared coefficient of variation of a random variable and the independence of the interarrival times \(\{S_i\}\) to observe that

as \(\text{Var}(S_1)/t_a^2= c_a^2\). Note that the SCV of the batch interarrival times is now expressed in terms of the batch size \(k\) and the SCV \(c_e^2\) of the interarrival times of individual jobs. Since we assumed that \(c_a^2\) is known, it is simple to compute \(c_{a,b}^2\).

In a similar way, we derive the SCV of the processing times of batches. Using that the setup time is assumed to be constant,

where we use that \(\text{Var}(T_1)/t_e^2 = c_e^2\), i.e., the SCV of the processing time of a single job. Again, we note that \(c_{e,b}^2\) is expressed in terms of notions that are available for single jobs.

## Wait in Batch Time¶

After a batch leaves the queue, each job individually has to be processed. The first job has to wait for the set up, the second job has to wait for the setup and the time to process the first job, and so on. Therefore the total time spent waiting for getting to the server is

so that the average wait in batch time becomes

## Total Average Cycle Time¶

The total CT is the sum of all the above terms plus the service time itself:

where

and \(c_{a,b}^2\), \(c_{e,b}^2\) and \(u_b\) have been derived above.