File Exchange

image thumbnail

Nagel Schreckenberg model implementation

version 1.4.0.0 (4.01 KB) by Alexander Farley
Simulation of the Nagel Schreckenberg single-lane traffic model, with visualization and plotting.

11 Downloads

Updated 10 Feb 2015

View License

Simulation the Nagel Schreckenberg single lane model. All standard parameters are implemented:
-vmax
-density
-braking probability

Also, rendering flag allows user to disable rendering for faster flow-density curve calculations.

Cite As

Alexander Farley (2019). Nagel Schreckenberg model implementation (https://www.mathworks.com/matlabcentral/fileexchange/34956-nagel-schreckenberg-model-implementation), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

nguyen

Son

Hi Alex,
I've tried your code out in R2011a and it works perfectly. I'm just wondering how I would go about drawing up a time/cell plot from it to show flow over time? (Similar to what you have implemented in your analyze.m file) I can't quite figure out how to do it.

Thank you in advance

sgtdf

Hi Alex,
I tried your code in R2011b, the figure shows a only single straight line at flow value of zero, can you please fix it? Or tell me the reason why? Thank you very much for your help.

Updates

1.4.0.0

Updated to support Octave

1.3.0.0

Fixed calculated of total flow for FD plot

1.2.0.0

Fixed a problem with vmax=1 showing zero flow.

1.1.0.0

Fixed problem with vehicle velocity updates.

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux