A Discrete Event Barber Shop Simulation

A simulation based project is designed which can be practically implemented in a workspace (in this case, a barber shop). The design algorithm provides the user different time varying features such as number of people arrival, number of people being served, number of people waiting at the queue etc depending upon input criteria and system capability. The project is actually helpful for a modern barber shop in which a close inspection is needed. The owner or the manager of the shop can easily have a thorough but precise idea about the performance of the shop. At the same time he/she can easily decide to modify the arrangement and capability of the shop.


I. INTRODUCTION
Simulation [10] is nowadays an accepted means to imitate the operation of real world systems.It has emerged as one of the dominant management science methods for the study and analysis of various types of systems such as communication system, traffic management system, hospital or a market management system etc.Due to complexity, stochastic relations and other situations lying in the system, it is not always possible to represent a real world system in a model form.One may think of an analytical model for such a system.But it essentially requires so many sampling assumptions to make the solution satisfactory for implementation.In such a situation the only alternative lying with sufficient reliabilities to the decision maker is simulation [1].
It is noticed that a graphical representation of output is more feasible for human brain to understand.Keeping in mind that thing, we designed the system so that it can provide different performances of the shop graphically.At first the algorithm asks for the day input.Then it takes input time i.e. the time at which the shop is open.After that it enters into corresponding time slot and performs logical operations and arithmetic calculations.The logical comparison serves the system features.For specific it performs the comparison between the no. of people arrival and the no. of server activated.From this comparison it determines the number of people rejected at any instant, number of people waiting at the queue, number of people being served and efficiency of the system.
In this paper the simulation model we used is presented in section II.It assumes general simulation process and features of the model.Section III shows the flow chart and the simulated result respectively.In section IV, we concluded about the design, its importance at practical case, limitations and also the possible improvements to the simulation model that are expected to be done in future.

II. SIMULATION MODEL
A simulation model [1] often takes the form of a collection of assumptions about the operation of a system.These assumptions are generally expressed as a mathematical or logical relation among the objects of interest in the system.Then the model is executed over time to obtain representative samples of performance measurements.This can be easily done using a computer [4,7].To have the best approximation of the mean of the performance measurements, we averaged the sample results.However, other factors such as the starting conditions of the simulation, the length of the period being simulated, and the accuracy of the model depend on how good our final estimate will be.The general simulation process [11] has the following steps: In case of our design we at first developed the model to fulfill the objectives.To implement the design, we took computer program approach.We adopted MATLAB software to program.
In this simulation process the principle behind the methods is to develop a computer based analytical model.The model predicts the behavior of the system.Then, the model is evaluated, and therefore the behavior is predicted several times.Each evaluation (or called simulation cycle) is based on some randomly selected conditions for the input parameters of the system.We can use several analytical tools to ensure the random selection of the random parameters according to their individual probability distributions for each evaluation.Thus a number of predictions of the behavior are obtained.
At first the design algorithm takes day input.As our program architecture, the input may be of two types: 0 for Friday (off day in Bangladesh) and 1 for other days.The program pointer enters the corresponding day block and asks www.ijacsa.thesai.orgfor time input.This is the time at which the shop is opened.Depending upon the time slot selected the program performs logical operations.Actually the program compares between number of server required and number of server available.Depending upon the comparison result the program calculates number of people arrival, number of people before giving service, number of people taking service, number of people waiting at the queue after servicing and efficiency of the system at any instant.
To determine number of people arriving at any instant we can adopt probabilistic method.There are different types of distribution functions [5] which can be used to fulfill our purpose.We may use one of the following distribution functions:

A. Normal Distribution Function
Normal distribution [3], also called Gaussian distribution is the most common distribution function for independent, randomly generated variables.It is often used in statistical reports, survey analysis, quality control resource allocation and other presentation schemes.It generally takes the form of a bell-shaped curve.
The graph of the normal distribution [16] is characterized by two parameters: mean and standard deviation.Mean or average of the normal distribution is the maximum value of the graph.The graph is always symmetric about the point of mean value.The rest one thing, standard deviation determines the amount of dispersion away from the mean.A small standard deviation compared with the mean produces a steep graph, whereas a large standard deviation produces a flat graph.The normal distribution can be expressed by the normal density function [6,15].
(1) In the above equation, exponential function e is the constant 2.718281828…, μ is the mean, and σ is the standard deviation of the distribution.The probability of a random variable falling within any given range is proportional to the area enclosed by the graph and x-axis within that range.The denominator (σ√2π) is known as the normalizing coefficient.It causes the total area enclosed by the graph to be exactly equal to unity.So, probabilities can be obtained directly from the corresponding area-i.e., an area of 0.5 corresponds to a probability of 0.5.Working mathematically with normal distribution is easier than other distributions.It also provides satisfactory estimation performances.It is the main reason behind why normal distribution is used widely in many practical cases.But whether we can choose normal distribution or not is determined by the size of a sample N. If the sampling distribution corresponds to large N then we can approximate it by the normal distribution even if the population distribution itself is not normal.

B. Generation of Random Probability Value
Random numbers are always in the form of real values.If we normalize these values dividing by the largest possible value, results are the real values in the range [0, 1].These numbers follow uniform distribution on the range [0, 1].A complete set of random numbers should also satisfy the condition of non-correlation for the purpose of simulation use.The common types of random number generation [9] methods are: We adopted the third one that runs recursive functions upon a seed.

C. Generation of Random Variables
Inverse Transformation Method [12]: Inverse transformation method is a familiar random number generation method.The computer based recursive functions of the project use this method.The steps in inverse transform method are:  The value of a generated continuous random variable X, is determined as follows X=F -1 X (R) = the inverse of the Normal distribution function of the random variable X evaluated at u.In the above equation, σ = Standard deviation, μ = mean.For a single variable, σ = x-µ.So putting this in (1) we get x=µ+ (2*pi*r) -1 .Here x is the random variable.

III. SIMULATED OUTCOME
The program executes according to the flowchart of figure 2. It asks for day and time input.Then as per the simulation model it performs necessary comparison, selection, estimation and calculations.Then it demonstrates different desired performance characteristics in graphical manner.Figure 3 shows the number of people arrival at any instant.This number is equal to the quantity that is found from normal distribution.Figure 4 shows total number of people that is to be served.This is equal to the quantity that is found from normal distribution plus the previous people waiting for service.First we the day input.According to the input day we divide the day into two slots.If input is =0 the algorithm realizes it as Friday.If input is =1 then algorithm realizes it as other days If input is =1 then algorithm realizes it as other days.The program pointer enters the corresponding day block and asks for time input.This is the time at which the shop is opened.
Depending upon the time slot selected the program performs logical operations specified for corresponding time slot.Actually, the program compares between number of server required and number of server available.Depending upon the comparison result the program calculates number of people arrival, number of people before giving service, number of people taking service, number of people waiting at the queue after servicing and efficiency of the system at any instant.total number of people is to be served is less than the capability of system then number of people is being served is equal to people arrival.If number of people to be served is greater than capability then the excess people will be rejected.This is shown in figure 6. Figure 7 shows the efficiency of the system.p(x) = (exp−(x − μ) 2 /2σ 2 )/σ√2π www.ijacsa.thesai.org

IV. CONCLUSION
The project we performed is actually helpful for a modern barber shop in which a close inspection is needed.The user can have a precise idea about the performance of the system.The logical development of this project can be easily understood.
The calculation of random variable (number of people arrival in this case) is done using normal distribution function.The average is specified in each slot programmed.Then comparing with the capability (no of server), simulation of the performance is done.
Although this simulation logic is not complex, it is very useful in practical case.The simulation plays vital role in a modern barber shop.Observing the graphical outcomes the owner or the manager of the shop can easily decide number of server at any instant and use the existing servers efficiently.He or she can also have highest efficiency observing the response of the system.
Again we assigned the average of the people arrival, at each time slot manually in the program code.The average can be calculated from the inspection of performances at several instants randomly.The average may be arithmetic mean, geometrical mean.This will make the simulation model more realistic and smarter.
Triangular Distribution function  Uniform Density Function  Cumulative Function  Poisson Distribution Function  Exponential Distribution Function  Normal Distribution Function For simplicity and compatibility with the system we used Normal distribution to construct the program code.

Figure 2 .
Figure 2. Flow Chart of Discrete Event Barber Shop Simulation

Figure 3 .
Figure 3. Depiction of no. of people arriving at any instant.

Figure 4 .
Figure 4. Depiction of no. of people at the queue before service

Figure 5 .
Figure 5. Demonstration of no. of people taking service Fig 5 represents number of people that is being served.Iftotal number of people is to be served is less than the capability of system then number of people is being served is equal to people arrival.If number of people to be served is greater than capability then the excess people will be rejected.This is shown in figure6.Figure7shows the efficiency of the system.

Figure 6 .Figure 7 .
Figure 6.Demonstration of no. of people at the queue after service