Question: In Java Consider a parking lot with 500 parking spot s where c ars arrive and depart randomly. Simulate this parking lot with following parameters

In Java

Consider a parking lot with 500 parking spots where cars arrive and depart randomly. Simulate this parking lot with following parameters for one day.

Residency time of cars are average 5 hours with uniform distribution [3,7]. This means you have to create a random real number between 3 and 7. You can assume upon the departure of the car, another car will arrive in the same spot.

You must ensure that the total number of hours for cars in each spot does not exceed 24 hours, as we are simulating a parking lot for one day. This can be implemented in different ways such as have a counter.

Jobs have average duration of 3 hours with uniform distribution of [2,4]. This means you have to create a random real number between 2 and 4. You can assume your job queue has large number of jobs. In other words, there are unlimited number of jobs in the queue.

Level of redundancy is 1 which means a job will be assigned to 1 car.

Note: The assignment of the job to cars are random. For example, Job 1 will be assigned to Car 1. If the duration of the job is smaller than the car residency time, the job will be completed. Otherwise, the job will not be completed at the same time the resource will be wasted. In other words, Car 1 will not complete the job although it was running the job.

Calculate the number of completed jobs in 24 hours. Run your simulation for at least 20 times and plot the average.

Change the parameter values and plot the result.

Job duration 2

Residency 2, 5, 8, 11, 14, 17, 20, 23

Job duration 3

Residency 2, 5, 8, 11, 14, 17, 20, 23

Job duration 4

Residency 2, 5, 8, 11, 14, 17, 20, 23

Job duration 5

Residency 2, 5, 8, 11, 14, 17, 20, 23

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!