A new version with a completely different (and now extensible and flexible, but heavier) data structure.
It is running below capacity limit (ca every 25 frames for 2 lanes). You can see the emerging pattern of clusters of cars forming with stop-and-go behavior. This is emerging because cars only take the car in front of them as reference in order to decide whether to accelerate or break. (they also look on left and right to change lane, but this is here not the most important factor). I assume this pattern would not appear as strongly if the cars would look one car further.
Number of cars driving (blue); Number of cars entering (yellow); Average trip duration (orange):
In absence of traffic jam, both curves will slightly oscillate to around constant value.
If there is a traffic jam, the blue curve will keep growing, until the yellow curve steps down.
It is running below capacity limit (ca every 25 frames for 2 lanes). You can see the emerging pattern of clusters of cars forming with stop-and-go behavior. This is emerging because cars only take the car in front of them as reference in order to decide whether to accelerate or break. (they also look on left and right to change lane, but this is here not the most important factor). I assume this pattern would not appear as strongly if the cars would look one car further.
Number of cars driving (blue); Number of cars entering (yellow); Average trip duration (orange):
In absence of traffic jam, both curves will slightly oscillate to around constant value.
If there is a traffic jam, the blue curve will keep growing, until the yellow curve steps down.
Parameters | Spawn Frequency: 1 car every iterations (if previous car is not too close). | |
Cars entering | Total: | Last 10 seconds: |
Total number of cars driving: | ||
Cars leaving | Total: | Last 10 seconds: |