![]() |
![]() |
||
| HOME | WEB DESIGN | COMPUTING | GRAPHICS/PHOTOS | MUSIC | |||
|
Early UK Computer Mags
Commodore 500/600/700
CBM BASIC Program Lister
Commodore PET Brochure
Spam Safe Email Address?
DLX Simulator
Gnome's Computers
Java Applets
Introduction
Solar System
Logic Gates
TrafficSim - T-Junction
TrafficSim - Roundabout
TrafficSim - Download
Magazine Indexer
Fixing Firefox Extensions
|
![]() |
TrafficSim - T-JunctionJava AppletsThe original of this applet was written while I worked at AngliaCampus though they never actually made use of it. I have since improved it (well, removed a few bugs anyway). The paths the traffic takes are all set up as HTML applet parameters and the roundabout example on the next page uses exactly the same applet but has different parameters set up. Do a view source on this page to see the parameters sent to the applet. The applet is quite complex and can simulate rush hours and different sets of traffic light sequences. Vehicles appear at random intervals and are constantly checking the path in front of them to see if it is clear - sometimes this results in a stream of traffic 'kangarooing' along in sequence. Currently, the vehicles only have two speeds - running and halted! However, in general, this doesn't detract from the effect. The double sets of counters are the total number of vehicles that have come from that direction (small counter) and the current number of queued vehicles (large counter). The Clock counter represents the time of day. The drop down menu allows access to various aspects of the applet (for example, it is possible to set up traffic light sequences that cause vehicles to crash). If you see a vehicle with a red cross on its roof then it has just jumped an amber light! To start the traffic just change the drop-down menu from Stopped to Running |
|
| Copyright ©2003-2010 davidviner.com Terms and Conditions | |||
![]() | |||