Browse Search Popular Register Upload Rules User list Login:
Automatic Traffic Control

screenshot of the scene

Author: Xray

Group: Default

Filesize: 288.62 kB

Date added: 2016-11-10

Rating: 6.7

Downloads: 5288

Views: 636

Comments: 17

Ratings: 5

Times favored: 1

Made with: Algodoo v2.1.0


Scene tag

This simulates automobile traffic (3 cars) being controlled by traffic lights (the type that we have here in the U.S.) at different intersections. Lasers in front of the cars do all of the sensing for automatically controlling the cars and for changing traffic lights.

The three cars are color coded, Blue, Red, and Green. You can leave the scene run automatically, or you can alter the traffic by starting and stopping any of the cars by clicking on the colored boxes.

The traffic lights do a pretty good job of preventing collisions at intersections, but of course if you are too aggressive with the Start and Stop controls, you can cause crashes.

There is a fork in the road on the left side of the map which alternates between Left Turn and Straight. This gives the traffic some variation.

This is not a game. It's just something for you to play with when you are bored. :lol:

UPDATE: . . . Added a purple Police Car which is autonomous (that means it operates by itself, and you cannot control it. Of course you can "cheat" by grabbing it with the Move or Grab tools, but that's no Phun!). :lol:

UPDATE: . . . Improved traffic control at intersections, and made cars go slightly faster (if they go too fast, they crash!).
Last edited at 2016/11/15 06:20:51 by Xray
Please log in to rate this scene
Similar scenes
Title: Super sonic rocket
Rating: 4.875
Filesize: 52.18 kB
Downloads: 1042
Comments: 2
Ratings: 2
Date added: 2015/01/30 20:30:45
Made with: Algodoo v2.1.0
Rating: rated 4.9
Title: Traffic Control System
Rating: 5.8182
Filesize: 17.05 kB
Downloads: 1024
Comments: 5
Ratings: 5
Date added: 2009/10/09 11:24:12
Made with: Algodoo demo
Rating: rated 5.8
Title: Traffic Jam: No lights vs. Lights
Rating: 5
Filesize: 107.05 kB
Downloads: 836
Comments: 5
Ratings: 1
Date added: 2015/12/24 18:49:42
Made with: Algodoo v2.1.0
Rating: rated 5
Title: THYME traffic simulation with Traffic Lights (UPDATED AGAIN)
Rating: 8.52
Filesize: 85.81 kB
Downloads: 7448
Comments: 10
Ratings: 19
Date added: 2009/12/27 01:14:20
Made with: Phun
Rating: rated 8.5
Title: Traffic Light - Finally Fixed (Algodoo Only)
Rating: 5.7778
Filesize: 75 kB
Downloads: 894
Comments: 1
Ratings: 3
Date added: 2010/01/09 18:48:02
Made with: Algodoo before v1.8.5
Rating: rated 5.8
Title: Traffic Laws
Rating: 5
Filesize: 414.22 kB
Downloads: 389
Comments: 1
Ratings: 1
Date added: 2016/01/18 20:27:38
Made with: Algodoo v2.1.0
Rating: rated 5
why not 5
Cool but. Why variables won't save?
And do you know how to make variables like this?
laser : e._motor = true
on axle
motor = {e._motor}
Or something.
Good job. This must have take a while to make. Maybe you can make a "wild car" that obeys all the traffic signals, but can't be controlled by the user. This way the user can clone the car as many time as he wants and load up the roads.
Can you add more track? and also. Why does algodoo dont use sound?
Variables that begin with an underscore character are local variables, and they will save their values when the scene gets saved. You must define local variables in the geometry that uses them. They cannot be defined in the global scope (such as in the Console). You define them in that text input box in the upper-left corner of all Algodoo objects. So, for example: _motor := false.

The variables that don't always behave the way we expect them to behave are global variables, such as "" variables. They don't save when transferred from one scene to another. They also have other problems which I don't recall, but you can find more information about variables in the Algodoo forum.

Yes, of course more track could be added. Will I add more track to this scene? Probably not. Algodoo does not use sound because the creator of the program did not give it the ability to produce sound. A couple of Algodoo users figured out a way to make Algodoo play sound files, but it's fairly complex and requires loading and executing external software from other websites which is always a risky thing to do. Search on "sound" here in Algobox and you should find those scenes.

Thanks! And thanks for the suggestion. I will consider it.

I know how very capable you are when it comes to scripting, and therefore if you would like to improve this scene in any way, please be my guest. Make it do some awesome things which I have not thought of! :)
OOOH! Nice!
Hmmm... it's really cool. I always want to build something lite that!
Bu I don't get it's logic. Too complicated structre IMHO. I'll try to simplify!
@Kilinich - Yes, please work your magic on this scene! I'm sure that you can come up with something more "A.I. like" than my simple logic. :)
Can you add more cars? can some be crazy and not follow traffic rules
Everyone wants more track and more cars! Well, yes, I am working on improving this scene as my time permits, and I think (I hope) that Kilinich will make some improvements too! He is a Master software engineer.
Cool thingy, really.
I just wish it wasn't one of these scenes who force you the play mode. I don't like play mode, it is really bothering (especially when it reset your Algobox tab into the home page). Also, it's getting really annoying to search everywhere where is the damn (sim.running ? (play.mode) : ()).
But aside of that, it's really cool.
LouFoxyBun -- You are a brand new user (some call you a "Newbie") and so you really don't have a right to complain. Well, you do, sort of, but you should learn more about Algodoo and about scripting before expressing your opinion.

There are good reasons to force playmode, and the main one is it hides the Move tool. When the Move tool is available, people can accidentally or intentionally use the Move tool to corrupt the scene. In playmode, the player only has access to the drag tool which works quite differently. I usually set up my scenes so that playmode automatically goes back to normal where all tools are available when the scenes stops running. Therefore, it should not be a problem.

Thanks for your comments.
Last edited at 2016/11/18 19:33:45 by Xray
:tup: this is so nice! Thanks a lot. One can use it also for creating own road-system, with the nice cars working on the "wire-roads". :*)
Nice nice nice
I like that it's just great!.You're done «:)»