International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 – 0882 300 Volume 8, Issue 6, June 2019

Simulation on Customer by Using (SRT) in Beauty Salon

Thwe1, Thi Thi Tun2 1(Faculty of Computer Science, University of Computer Studies (Taungyi), Taungyi Email: [email protected]) 2 (Faculty of Computer Science, University of Computer Studies (Myitkyina), Myitkyina Email: [email protected])

customer comes in particular given time, worker give ABSTRACT service to it according to their demand. Similarly, the The aim of processor scheduling is to assign processes to process is continues and queue is formed based on the be executed by the processor or processors over time, in functions. a way that meets system objectives. Scheduling affects The proposed system is intended to reduce waiting time the performance of the system because it determines for customers. Most of the people like to go to the which processes will wait and will progress. This paper beauty salon but they don’t like to wait in there. By proposes simulation on customer scheduling in beauty using SRT scheduling policy, waiting time can be more salon. In this simulation, Shortest Remaining Time reduced rather than other scheduling policies. Starting (SRT) is used to schedule this multiple processes from the system, the user enters the number of customers for the system because multiple processes may exist schedule in the beauty salon .The system displays the simultaneously. When a new process is entered the input dialog box for entering the number of customers. algorithm only needs to compare the currently executing The user enters customers’ name, arrival time and then process with the new process, ignoring all other must choose types of services depending on the number processes currently waiting to execute. Queue is first _ of customers. Then, the system calculates scheduling by in _ first _ out (FIFO) list and is a liner list of elements using Shortest Remaining Time (SRT). Therefore, the in which deletions can take place only at one end of the system displays customer who is firstly finished. list, “front”, and insertions can take place only at the other end of the list , “rear”. This system will be II. BACKGROUND THEORY implemented by Java Programming Language. An OS must allocate resources amongst competing Keywords – first in first out (FIFO), processors processes. The resource is allocated by means of scheduling, shortest remaining time (SRT) scheduling - determines which processes will wait and which will progress. The resource provided by a I. INTRODUCTION processor is execution time. Scheduling is to allocate processor time in such a way as to optimize one or more Customer scheduling makes human life very smarter and aspects of system behavior. Scheduling activities have to feel comfortable. Being a salon client today is three functions: long-term medium-term and short-term inconvenient. The customer have to remember that the scheduling. This system uses short-term scheduling. customer need to make an appointment, then hope he or Short-term scheduling is the decision as to whish she remember during business hours, and finally available process will be executed by the processor. The scramble to find the phone number and take time out of short-term scheduler also known as the dispatchers, his or her busy day to make the call. And never mind makes the fine-grained decision of which process to finding user reviews of local salons, tracking those down execute next [2]. somewhere on the web is a headache that most don’t The aim of processor scheduling is to assign processes to even attempt [1]. be executed by the processor over time. In a way that This is the experience of countless salon-visitors every meets system objectives, such as response time, day. As traditional methods of beauty salon are throughput, and processor efficiency. The scheduling inefficient, therefore proposed system is known as function should “customer scheduling” is considered here. Worker first  Share time fairly among processes calculates how many customers are waiting as well as  Prevent starvation of a process predefined time for particular activity. When the  Use the processor efficiently

www.ijsret.org International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 – 0882 301 Volume 8, Issue 6, June 2019

 Have low overhead short processes are continually added. This threat can be  Prioritise processes when necessary (e.g. real minimal when process times follow a heavy-tailed time deadlines) distribution. Like shortest job next scheduling, shortest remaining 2.1. Types of Scheduling time scheduling is rarely used outside of specialized environments because it requires accurate estimations of There are three types of scheduling: long-term the runtime of all processes that are waiting to execute. scheduling, medium-term scheduling and short-term Scheduling algorithm as the name hints, selects the scheduling. Long-term scheduling is performed when a process for execution which has the smallest amount of new process is created. Medium-term scheduling is a time remaining until completion [4]. part of the swapping function. Short-term scheduling It can be categorized into two parts: is the actual decision of which ready process to execute Non-preemptive: Once selected for execution, a process next [3]. continues to run until the end of its CPU burst .It is also known as Shortest Job First (SJF). Preemptive: The process which is currently in execution and runs until it complete or a new process is added in the CPU Scheduler that requires smaller amount of time for execution. It is also known as shortest remaining time first (SRTF). Unlike round robin scheduling algorithm, shortest remaining time scheduling algorithm may lead to starvation. If the short processes are continually added to the CPU scheduler then the currently running process will never be able to execute, SRT is not starvation free. Shortest remaining time is optimal and it mostly gives minimum average waiting time for a given set of CPU bursts of the processes. In SRT, We will never know the next burst length. Fig1. Scheduling and Process States Transitions Here, User can calculate the average turnaround time and average waiting time along with the starting and 2.2. Shortest Remaining Time (SRT) finishing time of each process. Turnaround time: It’s the total time taken by the Shortest remaining time, also known as shortest process between starting and the completion. remaining time first (SRTF), is a scheduling method that Waiting time: It’s the time for which process is ready to is a preemptive version of shortest job next scheduling. run but not executed by CPU scheduler. In this scheduling algorithm, the process with the smallest amount of time remaining until completion is 2.3. Shortest Remaining Time First (SRTF) selected to execute. Since the currently executing process is the one with the shortest amount of time SRTF is pre-emptive version of shortest job first CPU remaining by definition, and since that time should only scheduling. In this algorithm the process which is having reduce as execution progresses, processes will always shortest remaining time is executed first and completed, run until they complete or a new process is added that before completion of that particular process if another requires a smaller amount of time. process having shortest burst time or shortest remaining Shortest remaining time is advantageous because short time enters in ready queue then current running process processes are handled very quickly. The system also is pre-empted and new process is executed. requires very little overhead since it only makes a This preemptive version of the SJF algorithm is faster decision when a process completes or a new process is than the non-preemptive version .However, within our added, and when a new process is added the algorithm calculation for SRTF, we have not included any time for only needs to compare the currently executing process context switching .Context switching is required for all with the new process, ignoring all other processes preemptive algorithms. Time taken to perform context currently waiting to execute. switches will depend upon the particular system, but it Like shortest job first, it has the potential for process must be accounted [5]. starvation; long processes may be held off indefinitely if

www.ijsret.org International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 – 0882 302 Volume 8, Issue 6, June 2019

2.4. Shortest Remaining Time Next (SRTN) C4 Hair 200 150 This is a preemptive version of the previous one, in Straight(Distilla which the scheduler always dispatches that ready process tion) which has the shortest expected remaining time to completion. The dispatching decision is always made C5 Hair Distillation 260 60 when a new process is submitted: the currently running process has obviously a smaller remaining time than all other ready ones, otherwise it wouldn't have been Time=20 mins, C1 enter, dispatched. But a newly submitted job may have an even shorter one, in which case the currently running one Table (3.2) First Customer Enter Table would be blocked and put in ready state [6]. Service Arrival Service Execution Remaining This decreases the average turnaround time with respect Customer Type Time Time Time Time[s-e] to SPN, since short, newly arrived processes are given immediate attention, if their expected completion time C1 Frizz 20 90 0 90 happens to be less than the remaining time to completion C1 is executed of the currently running and ready processes. As with SPN, there's a risk of starvation for long processes, in 20 50 80 presence of a constant supply of short ones. Since all preemption decision are made only either upon a new process submission or when a process completes, there's less overhead involved than with RR.

III. SYSTEM OVERVIEW

The proposed system focuses on the customer scheduling who are arriving to the beauty salon. The Time =80mins, C2 enter. shortest remaining time (SRT) is chosen to schedule the customers in this system. The following tables show the Table (3.3) First Customer Enter Table step by step process of customers scheduling. Service Arrival Service Execution Remaining Customer Type Time Time Time Time[s-e] min[s-e]. equation 3.1 C1 Frizz 20 90 60 30 Hair C2 80 180 0 180 Straight Turnaround Time (Tr) =Finish Time - Arrival Time equation 3.2 where, e=time spent in execution so far Compare C1 (s-e) and C2 (Service_time) by using SRT s=total service time required by the process min[s-e], min[30,180], C1(s-e) < C2 (Service_time) C1 is executed.

Table (3.1) Customers Record Table 20 50 80 110 Customer Service _type Arrival Service Time Time(Ts)

C1 Frizz 20 90

C2 Hair Straight 80 180 Time =110 mins, C1 finish. C3 Hair 140 120

Straight(Wax)

www.ijsret.org International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 – 0882 303 Volume 8, Issue 6, June 2019

Table (3.4) First Customer Finish Table

Service Arrival Service Execution Remaining Compare C3(s-e) and C4(Service_time) , Customer Type Time Time Time Time[s-e] min[s-e],min[60,150], C3(s-e)

C2 is executed. Time =140 mins ,C3 enter. 20 50 80 110 140

Time=260 mins , C5 enter and C3 finish. Table (3.5) Third Customer Enter Table

Service Arrival Service Execution Remaining Customer Table (3.7) Fifth Customer Enter And Third Customer Type Time Time Time Time[s-e] Finish Table

C1 Frizz 20 90 90 0 Service Arrival Service Execution Remaining Customer Type Time Time Time Time[s-e] C2 Hair Straight 80 180 30 150 Hair C1 Frizz 20 90 90 0 C3 140 120 0 120 Straight(Wax) C2 Hair Straight 80 180 30 150 Hair C3 140 120 60 60 Compare C2(s-e) and C3(Service_time) , Straight(Wax) min[s-e],min[150,120], C3(Service_time)

20 50 80 110 140 170 200 Compare C2(s-e) and C5(Service_time) , min[s-e] , min[150,60] , C5(Service_time)

Time = 200 mins , C4 enter.

Table (3.6) Fourth Customer Enter Table

Service Arrival Service Execution Remaining Customer Type Time Time Time Time[s-e]

C1 Frizz 20 90 90 0

C2 Hair Straight 80 180 30 150 Hair C3 140 120 60 60 Straight(Wax) Time=320 mins, C4 Distillation 200 150 0 150 C5 finish.

www.ijsret.org International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 – 0882 304 Volume 8, Issue 6, June 2019

Compare C2(s-e) and C4(s-e) [6]https://en.wikipedia.org/wiki/shortest-remaining- min[s-e],min[150,150] time-next C2(s-e)=C4(s-e) C2 is executed and finish at Time=470 mins. And then C4 is executed and finish at Time=620 mins.

Table (3.8) All Customers Finish Table Customer Service Type Tr/Ts C1 Frizz 1 C2 Hair Straight 2.17 Hair Straight C3 1 (Wax) C4 Distillation 2.8 C5 Hair Distillation 1

IV. CONCLUSION AND FUTURE WORK

The proposed system will calculate finish time and turnaround time of each customer. We can know that how many times of service time for each customer are staying in the system .Then, this system will display the finish time, turnaround time and Tr/Ts. By using SRT, waiting time can be more reduced rather than other scheduling policies in system. Because of this system uses SRT scheduling policy, waiting time of each customer who has less service time can be more reduced rather than other scheduling policies. User can easily view the schedule of customer daily. By using this system, user can know finish time, turnaround time and Tr/Ts. This system can calculate only group of customers schedule. This system is implemented as standalone desktop application and can be used as a single user system. Moreover, this system can also describe customers’ schedule with Graphics.

V. REFERENCES

[1] Jadhav Vaishali1,Kumthekar Aarti, “Smart Hair Salon Management System”, International Advanced Research Journal in Science, Engineering and Technology National Conference on Emerging trends in Electronics & Telecommunication Engineering (NCETETE 2017) AGTI’s Dr. Daulatrao Aher College Engineering, Vidyanagar Extension, Karad Vol. 4, Special Issue 2, January 2017 [2] (Fifth Edition) - WILLIAL STALLINGS [3] https://en.wikipedia.org/wiki/scheduling-computing [4] https://en.wikipedia.org/wiki/shortest-remaining-time [5]https://en.wikipedia.org/wiki/shortest-remaining- time-first

www.ijsret.org