Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment you'll be simulating traffic in city. Specifically you need to complete trafficSimulator.c, trafficSimulator.h', road.c, road.h, car.h and event.h. You can change any

image text in transcribed
For this assignment you'll be simulating traffic in city. Specifically you need to complete "trafficSimulator.c", "trafficSimulator.h', "road.c", "road.h", "car.h" and "event.h". You can change any of the other files or create new files but you will need to also submit them. Here is brief description of the functionality of your simulation: 1 Intersections, Cars, and Traffic Lights Intersections and Roads . Intersections are the vertices of your graph. . Each vertex is represented by a unique integer value. . These range from 0 to size - 1 where size is the number of vertices. . The roads connecting them are edges of graph. . Each directed edge is represented by a triple of integers. . The first integer is the starting vertex. . The second integer is the ending vertex. . The third integer is the weight of the edge (i.e, the length of this road). . Cars traverse the edge based on order of arrival (i.e., no passing). You should use an array to represents the current contents of the road. During each time step every car with an empty space in front of it moves forward one position. Example: Suppose that - is an empty space on the road and the numbers represent 3 cars on the road. 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Boundary Value Problems And Partial Differential Equations

Authors: David L Powers, Powers Shelley

6th Edition

0080884415, 9780080884417

More Books

Students also viewed these Mathematics questions

Question

What is the purpose of small nuclear RNA? What is an snRNP?

Answered: 1 week ago