1. Learn
  2. /
  3. Courses
  4. /
  5. Discrete Event Simulation in Python

Exercise

Transportation model: defining model inputs

Let's put it together and build all the model components.

You have been asked to optimize the traffic lights of the city of Chicago to improve traffic flow. A discrete-event model is beneficial in these situations.

The first step is to measure the average length of roads between intersections, which you concluded to be 100 meters on average with a standard deviation of about 20 meters, which means that a driver is expected to encounter a traffic light every 80-120 meters.

The speed limit in Chicago is 30 mph (approximately 50 km/h). The city officials informed you that, on average, the light remains red for up to 90 seconds. Start by defining the inputs and outputs of your model.

Instructions

100 XP
  • Set the mean and standard deviation of the inputs["Dist_between_intersections_m"] array.
  • Apply the Gaussian distribution to generate RandomGener["Distance"] values.
  • Apply a random method to generate integers for RandomGener["WaitTime"].