File Exchange

image thumbnail

Nagel Schreckenberg model implementation

version 1.4 (4.01 KB) by

Simulation of the Nagel Schreckenberg single-lane traffic model, with visualization and plotting.

7 Downloads

Updated

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.

Comments and Ratings (5)

nguyen

nguyen (view profile)

Son

Son (view profile)

Thomas Kelly

Thomas Kelly

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

sgtdf (view profile)

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

Updated to support Octave

1.3

Fixed calculated of total flow for FD plot

1.2

Fixed a problem with vmax=1 showing zero flow.

1.1

Fixed problem with vehicle velocity updates.

MATLAB Release
MATLAB 7.11 (R2010b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video