DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004

    Question Help, Help on Traffic Simulation

    I have to do a project about Traffic Simulation and I am unable to figure out how to move a car.
    I have to put three signal and i have to show green, yellow and Red. and For example, the triplet (30, 5, 45) indicates that the signal will be in the red state for 30 s, in the yellow state for 5 s, and in the green state for 45 s.
    We were given also this information:
    o Vehicle acceleration. This is the average acceleration of the vehicle to increase its velocity from a stop. Use a default value of 2.4 m/s2 (the units are read ‘meters per second per second’). What this means is that the vehicle will increase its velocity by 2.4 m/s every second. Thus, a vehicle will reach 50 km/h (~13.9 m/s) from a standing start in ~5.8 s with no obstructions in front of it.

    Now first i have to know how a car will move and then how I am going to use the velocity and then how will i stop the car? and the car behind it? and no collision are allowed

    Could You please help??
    Thank you

  2. #2
    Join Date
    Feb 2004
    oh wow.. that's involved.. how many java applications have you written up to now?
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  3. #3
    Join Date
    Oct 2004



    Thank you for responding to my email. Sorry if i did not respond immediately, for a while I thought that no one would respond.
    I wrote 19 classes so far. Car.java is big because it has the big chunk of code to move the cars and stop them.
    I think I need a good methodology inorder to have this thinkg work. I also don't know how to involve the time correctly. I mean by that say I want to run the simulation for 2 minutes or 3. How do i say if it 2 minutes stop. Another point, when controlling the speed of the car, in the begining i want to increase the speed of the car by 2.4 m/s (meter per second) every second however after 5 seconds the speed should stay steady then, how could i say in the first second add 2.4 and in the second add 4.8????
    I know that no one would tell me how to write the hole code by a good direction from someone would help a lot and the timing part yes i really need help with too.

    Thank you very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

By using this site, you agree to the Privacy Policy