Write a BOSS program to analyze the pit operations of my racing crew, and run on BOSS. The crew performs the following operations when the driver makes a pit stop. All times listed below are distributed normally unless otherwise stated, i.e. if it says 4 to 6 seconds, that means it took him between 4 to 6 seconds, normally distributed.
a) Bill replaces the right side tires. It takes him between 4 and 8 seconds to jump the wall, between 2 and 10 seconds to get between the wall and the car and the same time to get from tire to tire. It takes him 10 to 14 seconds to jack the car and change a tire. Sometimes Bill goes around the front of the car, and sometimes he goes around the back, depending on how far forward the car driver stopped in the pit area. 40% of the time the driver stops too far forward for Bill to get in front of the car, so he goes around the back. 60% of the time the driver stops such that Bill goes around the front of the car. Bill returns the same way he went.
b) Jill replaces the left side tires. It takes her between 2 and 10 seconds to jump the wall, from 3 and 9 seconds to get between the wall and the car and the same time to get from tire to tire. It takes her from 8 to 16 seconds to change a tire.
c) Hill fills the tank on the left side of the car. It takes him between 1 and 10 seconds to jump the wall, between 4 and 10 seconds distributed uniformly to get from the wall to the car, between 8 and 12 seconds to attach the gas can spout to the car, 2 seconds to detach the spout, and between 20 to 40 seconds to fill the tank He carries two cans of gas, both of which are used to fill the car.
d) Phil washes the windshield and cleans the air intakes on the front of the car. He does his work from behind the wall with a long pole. If Bill decides to run in front of the car, Phil must wait until Bill has reached the front right wheel. Once he has begun the cleaning operation he will continue until finished, regardless of Bill. If the pole is in Bill’s way when he is ready to return, Bill has to wait until the pole is retracted. It takes Phil 5 to 10 seconds to extend and retract the cleaning pole, and 10 to 15 seconds to clean the intakes and windshield. Phil is always behind the wall, and the driver can leave even if he has not finished cleaning the windshield.
e) Bill can work without getting in Jill or Hill’s way, on the right side of the car, but may have to wait on Phil.
f) By SCCA rules, Jill and Hill cannot both operate on the left side of the car at the same time – the filler cap and tires are too close together. Thus, only one crew member is permitted to work on the left side of the car at once. Both can run to the left side of the car at the same time, but if Jill gets there first, she does her job completely, including the changing of both left side tires. As soon as she finishes the last tire, Hill can begin fueling. If Hill gets there first, Jill must wait until he is finished fueling. She can begin working as soon as he disconnects the second tank.
g) Our car is not permitted to leave until all personnel are back behind the wall, and no competing cars are in the area that want to pit in front of us.
h) Competing cars are also making stops in their pits. They come into pit road distributed exponentially, with a mean of 30 seconds. If a competing car enters pit road, and their pit is behind us, they do not influence us in any way. If their pit is ahead of ours, our car cannot exit until they pass. These cars require from 3 to 9 seconds to clear our pit. 70% of the pits are ahead of ours. If a competing car enters pit road after our car starts to pull out, it is the competing car’s responsibility to yield to our car. We are born at time 0 and it takes our car from 6 to 12 seconds to get into the pit. It takes from 2 to 5 seconds to exit.
Set up this simulation to determine the total time elapsed during a typical pit stop. The recorded time should start when we are born, and stop when we have exited the pit.
1) You could probably use either the seizure of resources or gates to keep the crew and drivers from being killed on the track, but I want both to be used. Thus, your code must use gates to keep the pit crew behind the wall until our car has entered the pit, and to keep the driver from running over a crew member until they are back behind the wall. Use the seizure of resources to keep me in my pit if oncoming traffic that pits in front of me is seen.
2) Every line of code must be annotated with an explanation for the purpose of that line. For example:
SETGATE{NAME = wallgate, STATUS = close}; “close wallgate to keep workers out until racecar stops”
Note the required quote marks.
No hand solution.