Wk-4 (Winter) - S2 Worksheet 1

docx

School

McMaster University *

*We aren’t endorsed by this school

Course

2PX3

Subject

Communications

Date

Feb 20, 2024

Type

docx

Pages

5

Uploaded by UltraTitaniumQuetzal28

Report
Engineer 2PX3: Communication and Societal Impact ENGINEER 2PX3: COMMUNICATION AND SOCIETAL IMPACT Week 4 Overview and Goals Conduct experiments with the given simulation to explore how different parameters affect the average response time. Begin working on several components for your Sprint 2 Report. o Tables 1- 4, as well as your graphs from Experiments 3.2 and 5 will be included in your Sprint 2 Report. 1
Engineer 2PX3: Communication and Societal Impact ENGINEER 2PX3: COMMUNICATION AND SOCIETAL IMPACT Have you ever been frustrated by traffic? Of course, you have. We have all found ourselves (some more often than others) in situations where, due to things believed to be beyond our control, our overall driving experience has been negatively impacted. This could range from something petty like someone ahead of you not paying attention to lights changing (looking at their phone) and, in turn, you are missing an advanced left to someone making a reckless lane change, causing a fatal accident on a major highway. This has become an accepted fact of modern life. We are aware that during rush hour, highways become congested, certain intersections cause delays, some roads pose accident risks, and there is always a chance of being involved in a serious accident whenever we drive. Space is at a premium. Expanding/building new roads is costly and often infeasible. So, are our roads destined to serve increasingly greater traffic loads than they were designed to handle, resulting in perpetually increasing commute times? Maybe… but how does the introduction of self-driving vehicles change this predicament? Think back to that time when you were frustrated in traffic. In general, there are two things that could have frustrated you. First, the roads. Second, the driver. What if that driver who was looking at their phone was in a self- driving vehicle? Would it matter? What about the reckless lane changer? How would these situations change with self-driving vehicles? One can conjecture. Perhaps a self-driving vehicle would never make such a lane change or restrict its driver from doing so. Or, perhaps a self-driving vehicle would be able to detect the reckless behaviour of drivers in advance or more quickly react to the lane change than a human driver would. How would self-driven vehicles improve traffic? How many lives could be saved? The City of Hamilton is looking to the future. They have identified several roads and intersections that would make excellent testbeds for self-driving vehicles. The first step in this process is to simulate an intersection and model the behaviour of self-driving vehicles. The city hired a summer student who created a simulation to model fully automated traffic arriving at a four-way stop. They made the following assumptions: Vehicles arrive on average every 10s. No two vehicles arrive at the same exact moment. It takes 5s for a vehicle to stop. o A vehicle will need to stop when it arrives at the intersection. o Once it has stopped once, it does not need to “stop” again. For example, after a vehicle in front of them clears the intersection. It takes 7s for a vehicle to clear the intersection (once they have stopped and it is their turn to go) 2
Engineer 2PX3: Communication and Societal Impact ENGINEER 2PX3: COMMUNICATION AND SOCIETAL IMPACT The intersection is a 4-way stop, consisting of four single lanes, following traditional traffic rules. Vehicles are equally likely to arrive from all directions. Vehicles always go straight. The city has the simulation file, but the student who created the simulation file has gone back to school – they are not sure how to use/interpret the results. Your team has been hired to work with the simulation file to determine its usefulness and how it can be expanded for more complex situations. The first part of your contract is to work through several experiments that the city has requested. Experiment 1 City employees have found out how to simulate 100 total vehicle arrivals, but they are confused (remember, they work for the government), they have run the simulation multiple times and have found that the average response time of the intersection can be quite different. Sometimes it is as low as 13s, other times as high as 20s. So, what is the actual average? Use intersection_sim1.py. Run 20 different simulations for 100, 500, 1000, 5000, 10000 vehicles. Before you do, make a prediction. What is happening, how do you explain it? Why not simulate 100000000000000000 arrivals? For how many vehicle arrivals do you think the simulation should be run? Why? Experiment 2 The city wants to know what happens when the performance of a vehicle’s clear and stop time is increased or decreased. That is, for safety reasons, the city wishes to increase the stop time of vehicles. Run some simulations: Use intersection_sim1.py. Vary the stop time while keeping all other parameters constant (using values from Experiment 1). Before you run the experiment, discuss with your group what you think will happen to the average response time. Record your results in Table 1 below with the following stop times (s): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Table 1: Average Travel Time of Intersection Based on Different Stop Times 1 2 3 4 5 6 7 8 9 10 11.09 11.83 12.56 14.05 How do the results of your simulation align with your initial guess? 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Engineer 2PX3: Communication and Societal Impact ENGINEER 2PX3: COMMUNICATION AND SOCIETAL IMPACT Experiment 3.1 Use intersection_sim1.py. Vary the clear time while keeping all other parameters constant (using values from Experiment 1). Before you run the experiment, discuss with your group what you think will happen to the average response time. o Specifically, do you think the clear or the stop time will have a more significant impact on the overall performance? Record your results in Table 2 below with the following clear times (s): 4, 5, 6, 7, 8, 9, 10, 11, 12. What is happening? Did the performance of the intersection behave as you expected? Table 2: Average Travel Time of Intersection Based on Different Clear Times 4 5 6 7 8 9 10 11 12 Experiment 3.2 Use intersection_sim1.py. Vary the clear time while keeping all other parameters constant (using values from Experiment 1). Clear time: Start with 8 but increase by 0.1 with each iteration up to and including 10.5. o Using a program of your choice, plot the response time as a function of clear time. This plot will be included in your Sprint 2 report. With finer grain detail, does this illuminate any behaviour or confirm any conclusions you drew from Experiment 3.1? Experiment 4 Right now, the stop and clear time are deterministic. This may be reasonable in the future when everything is automated, but is this realistic for human drivers? In reality, different drivers drive differently. What happens when the clear times are no longer constant. In other words, what happens when we make these times non-deterministic? Use intersection_sim2.py. What do you expect to happen when the average clear time remains 7 seconds, but the range of options increases? Will there be any differences between the simulations? o Note: the stop time remains at 5 seconds 4
Engineer 2PX3: Communication and Societal Impact ENGINEER 2PX3: COMMUNICATION AND SOCIETAL IMPACT Record your results in Table 3 below, with the clear time being a 50/50 choice between 6 and 8, 5 and 9, 4 and 10, 3 and 11, and 2 and 12. Table 3: Average Travel Time of Intersection Based Different Varying Clear Times 6 and 8 5 and 9 4 and 10 3 and 11 2 and 12 Experiment 5 Now that you have simulated the intersection for non-deterministic clear times, apply a similar treatment to the stop times. Use intersection_sim2.py. Have clear time be a 50/50 choice between 6 and 8, 5 and 9, 4 and 10, 3 and 11, 2 and 12. o For each of the above , now have stop time be a 50/50 choice between 4 and 6, 3 and 7, 2 and 8, 1 and 9. Record your results in Table 4 below. o Using a program of your choice, plot the response time as a function of clear time and stop time. This plot will be included in your Sprint 2 report. You may want to consider overlaying plots over one another using different colours or shapes to differentiate one of the variables. Based on the previous experiments, are your results aligned with your expectations? Why or why not? Table 4: Average Travel Time of Intersection Based on Different Varying Stop and Clear Times Clear time Stop time 6 and 8 5 and 9 4 and 10 3 and 11 2 and 12 4 and 6 3 and 7 2 and 8 1 and 9 Display this data on a graph of your choice. This graph will be included in your Sprint 2 report. 5