Question
Kleenes Car Wash is thinking of expanding and wants to do a computer simulation of a typical days business. The car wash is currently set
Kleenes Car Wash is thinking of expanding and wants to do a computer simulation of a typical days business. The car wash is currently set up such that is has four bays. The first two bays are small and can only service smaller sized cars. The other two bays are larger and can service any size vehicles. When cars enter the car wash, they are given a ticket with a number on it and enter a waiting queue. They remain there if all bays are occupied. If a large car is at the front of the queue and a small bay is open, it can not use the bay and it will stand idle until the large car can access a larger bay, and only then can the next car, if it is smaller, use this bay. (Employees can use this time break to do routine upkeep.)
The car wash operates on a ten hour business day and because of the lot size, at most 12 cars will be able to wait for service at any time. If a car arrives and there are 12 cars waiting, then it is turned away, much to the owners chagrin.
To perform the simulation, sequentially-numbered tickets are assigned to each incoming vehicle and a time is stamped on each ticket. To keep the simulation simple, this time will be a count of the number of minutes elapsed from the start of the business day. So the time could be any values from 0 to 570 (no new business will be allowed 30 minutes before closing, so the waiting queue can be cleared out, hopefully, before the end of the business day.) There will be a time counter which will start at 0 when the simulation starts. Also each car will be assigned a size of small or large to indicate the type of bay it can use. A small car will use the bay for 12 minutes and a large card will use the bay 20 minutes.
The input data will have the cars listed in order of the time they arrive and no two cars will arrive in the same minute. This means that if a car arrives at time 10, there will be no cars in the file afterwards that arrive earlier than that time and no other car will arrive at time 10.
This simulation will inform the owner how many vehicles were turned away, and the average time any vehicle in the queue spent waiting.
You might need the following classes and structures. You are free to combine, modify, delete, or add to these as needed.
class Node
{
};
class Queue {
};
struct Customer_record
{
int number;
char size; // L for large, S for small
int arrival_time;
};
class Bay_type
{
int timer;
char status; // a - available, i inactive
int time_limit; // 12 for small cars, 20 for larger cars
};
class Sim_data
{
int time_cnt; // ranges in values from 0 to 570
int num_serviced; // number of vehicles washed so far
long tot_wait_time; // of all vehicles in the queue
Iit num_turned_away; // count of vehicles turned away
};
Sample data:
1 S 10
2 L 17
3 L 20
4 L 22
5 S 25
.
.
.
30 S 73
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started