Difference between revisions of "Crossroad simulation"

From Simulace.info
Jump to: navigation, search
(Results)
(Results)
Line 81: Line 81:
  
 
[[File:Tab.jpg]]
 
[[File:Tab.jpg]]
 +
[[Media:Tab.png]]
  
 
= Conclusion =
 
= Conclusion =
  
 
= Model source code =
 
= Model source code =

Revision as of 19:41, 17 January 2016

Problem definition

The simulated crossroad is meeting point of heavily used streets Sokolovska, Jecna and Legerova. We can see the situation on following map. The roads are crossed by a tram rail and there is also a subway and tram station near the crossroad. So we can expect high numbers of cars and pedestrians.

Map.jpg

On the picture we can see 3 more little streets that will be simulated. On the crossroad, there are several traffic lights which are controlling the traffic. We are not taking into account that pedestrians can walk into stores or buildings and that cars can stop in parking spots. This should not affect the reality so much.

Goal

The main goal will be to find the ideal intervals to lower the waiting times to minimum. Of course we need to keep in mind that the traffic should be safe and fluent. Safety of the crossroad is assured by the timing of the lights and by the code.

  • Pedestrians take precedence on crossings
  • Cars or trams cannot crush into each other
  • Lights should be set in the way, that cars and pedestrians won't meet on the street (of course, in some cases it is possible, e.g. turning right)

To measure the goal, the simulation is using average time, in which the agent will leave the simulation (average time to leave = AVG-ttl). This value is then printed into the graph separately for each kind of agent. Also they are visible in numbers above the graph.

Method

NetLogo 5.2.1

This software is used because of each of the objects can make its own decisions.

Detailed description of the method

In the net logo, I created following model of the real crossroads.

Map2.jpg

  • Black = Roads
  • Blue = sidewalks
  • Brown = tram rail
  • Yellow = places where cars can turn
  • Red = places where cars can change lane
  • Black numbers = pedestrian spawn points
  • Black letters = places, where pedestrians are making change of direction
  • White letters A-F = pedestrian crossings with lights
  • White numbers = traffic lights for cars
  • White letters y,z = rail crossings

Agents

Pedestrians

Pedestrians are using sidewalks (blue). They are randomly spawned on one of the number-marked points and their destination is also selected as random number. Then they are moving forward until they hit one of the letter-marked patch or their destination. On the letter-marked patches (decision points) they will decide, which direction they will go next. If they reach destination, they will die. If there is a crosswalk in front of them with red traffic light, they will wait for the green light. They will ignore red light, if they are already crossing the road. On the crosswalks without lights, they won’t stop (they take precedence).

  • speed – the distance that will agent travel in one tick. It’s also used as checking distance for lights
  • destination – random number (1-14) marking the destination of the agent. Used for making decisions
  • spawn-time – time (ticks) when agent was spawned

Trams

Trams are spawned on one of the spawn points on one of the ends of the tram rail (brown). Then they will go towards the other end of the tram rail. If the traffic light for trams in front of the tram is red, it will wait for the green light. Also the tram will stop, if any other tram is in front of it.

  • speed – the distance that will agent travel in one tick. It’s also used as checking distance for lights
  • spawn-time - time (ticks) when agent was spawned

Cars

Cars are using roads (black). They are randomly spawned on one of the spawning points (number-marked black patches on the edges of the map). Also their destination is selected randomly as one of the letter marked points. Depending on their destination cars can change lines (red marked areas) or turn (number marked points in the crossroads). If the traffic light for cars in front of the car is red, it will wait for the green light. Also the car will stop, if any other car or pedestrians are in front of it.

  • speed – the distance that will agent travel in one tick. It’s also used as checking distance for lights
  • destination – random number (1-3) marking the destination of the agent. Used for making decisions.
  • waiting? – Boolean, if the car is waiting on the green light
  • changing-line? – how long will the car currently be changing lines
  • spawn-time - time (ticks) when agent was spawned

Lights

The traffic lights are spawned in the simulation with the draw procedure. There are actually three kinds of agents – lights for cars, trams and for pedestrians.For their function is used build-in variable color. Color is changed in regular intervals derived from the ticks counter and global setting.

Simulation controll

  • setup (S) – will draw the map and reset ticks counter
  • go (G) – will start/pause the simulation
  • sim-speed – speed of the simulation, will change the wait times between the ticks
  • Xprob – probability for spawning certain agent in next tick (P – pedestrian, C – car, T – Tram)
  • change1, change2, global-time – settings of the timing of traffic lights

Results

File:Tab.jpg Media:Tab.png

Conclusion

Model source code

  1. ŠALAMON, Tomáš. Design of agent-based models: developing computer simulations for a better understanding of social processes. Řepín-Živonín: Tomáš Bruckner, 2011. ISBN 978-809-0466-111.