Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use python to code this problem. This task requires physics modelling and computer science knowledge. 2. The Nagel-Schreckenberg cellular automata ( 30 points) (a) (20

Use python to code this problem. This task requires physics modelling and computer science knowledge.

image text in transcribed

image text in transcribed

2. The Nagel-Schreckenberg cellular automata ( 30 points) (a) (20 pts) Starting from the simple bulding blocks for a traffic model discussed in the lecture, write a code implementing the rules of the Nagel-Schreckenberg model (see page 11 of the lecture notes). We want to consider, in particular, a model with 100 cells which are periodically connected. The maximally allowed velocity is 5 in units of cells. (b) (10 pts) As initial state, place 10,20,50 cars at equal distances, all with velocity 1 . Consider a randomization p=0.3 (probability that velocity is reduced by 1). To implement the randomization of the velocities you can use the np.random routines, see numpy documentation. Plot the time evolution for 100 time steps in the three cases. In which cases do traffic jams occur? Nagel, K.; Schreckenberg, M. (1992). "A cellular automaton model for freeway traffic", Journal de Physique I. 2 (12): 2221.: The following four actions are conducted in order from first to last, and applied to all cars. - Acceleration: All cars not at the maximum velocity have their velocity increased by one unit. - Slowing down: Check if distance between a car and the car in front (in units of cells) is smaller than its current velocity. If the distance is smaller than the velocity, the velocity is reduced to the number of empty cells in front of the car to avoid a collision. - Randomization: The speed of all cars that have a velocity of at least 1 , is now reduced by one unit with a probability of p. - Car motion: Finally, all cars are moved forward the number of cells equal to their velocity

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

Step: 3

blur-text-image

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago