In this Simulation of Handoff Techniques in Mobile Cellular Networks project, the simulation procedure of hand-off techniques in mobile cellular networks has been presented. Several studies have been conducted to determine the cell hand-offs mean number and expected average strength of signal.

In literature part, the performance measures of MM1 queue and its waiting time distributions are estimated. To simulate both MMC and MM1 Queues, we made use of java coding. Also, we created a Queue class in java, where the clients of de-queue and en-queue are encoded.

We have also created histogram class to display results of simulation. At the end, the actual time as well as waiting time of both the queues is estimated and shown in the form of graphs.

Code and Results Explanation:

I have used to java coding to simulate the MM1 and MMC Queues. Below is the sample code of MM1 queue

double lambda = 0.6;  // arrival rate

double mu     = 0.8;  // service rate

I have taken an initial service and arrival rates of the clients and in this case a single server and infinite clients are used with a queue length of infinity. I have created a Queue Class in java where the en-queue and de-queue of clients are coded. A histogram class is created to display the simulation results and the actual service time and waiting time are shown in graph form as shown in the below code

Histogram hist = new Histogram(60);

hist.addDataPoint(Math.min(60,  (int) (Math.round(wait))));

hist.draw();

A random class is used to derive the service rate of the clients and the actual waiting time of the clients across the queue is also calculated using the below code

double nextArrival   = StdRandom.exp(lambda);     // time of next arrival

double nextDeparture = Double.POSITIVE_INFINITY;

By default the next departure of the client is considered as infinity and this variable is updated during the execution of the project. Initially the condition if next arrival rate of the client is less than next departure of the next client is checked and if the condition is satisfied another condition like whether the queue is empty or not is checked. Once all the conditions are satisfied, next arrival rate of the client is assigned with a random number as shown in the below code

if (nextArrival <= nextDeparture) {

if (q.isEmpty()) nextDeparture = nextArrival + StdRandom.exp(mu);

q.enqueue(nextArrival);

nextArrival += StdRandom.exp(lambda);

If the above mentioned conditions fail, the actual waiting time of the client in the queue is calculated using the below code

double wait = nextDeparture - q.dequeue();

The actual queue size used in this process is also calculated along with the mean queue length as shown in the below code

mql=row/(1-row);System.out.println(mql);

StdOut.printf(“Wait = %6.2f, queue size = %d\n”, wait, q.size());

After running this code the actual simulation results are as shown below

actual simulation results output

actual simulation results output

actual simulation results

actual simulation results

MMC Queue simulation:

Similar procedure is used to develop the MMC Queue simulation but the number of servers considered in this process is 4 and the only code change is as shown below

double wait = (nextDeparture - q.dequeue())/4;

row=lambda/(4*mu);

mql=row/(1-row);System.out.println(mql);

Now the actual wait time and mean queue length are decreased by 4 times using this MMC Queue implementation as shown in the below the screens

MMC Queue implementation output

MMC Queue implementation output

MMC Queue implementation

MMC Queue implementation