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??
oh wow.. that's involved.. how many java applications have you written up to now?
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
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL