March 01, 2006
Final Done.
If anyone fancies having a go with it and sending any comments i would be grateful. Cheers
Unzip and run java Engine or use the batch file
February 28, 2006
TO DO:
2 days:
1. Develop the graph (re add back in vehicles/sec? Wasnt that useful). Add output.
2. Develop Aggression
- +-10% speed
- +-10% headway
- +-10% accel/dcel
3. Add crashes. Not sure what to do here. Will either have a billion crashes or none?!
4. If have time, add offramps. Although not sure how usefull to show traffic?
5. Tidal flow for on-ramps?
6. Presentation.
February 21, 2006
Linux is SHIT
To Fix:
Cannot change ents properties when sim is NOT running
Java messes up loading of blocked lanes
Lane closed panels needs updating when opened
February 18, 2006
Nearly Done
To Do:
Output from graph (csv?)
OffRamps
Standing Traffic (could leave out, not sure would be that useful)
Sort out simulation start/stop so can change ents whilst running, but not add/remove
Touch up dialogs
Problems I have had:
The backend is annoying, should have made addNext() addBack() etc incorporate adding the vehicle to the other itsself. Save on errors
Some issues with the backend, cars would drive over each other. Found to be beacuse i was using floats not doubles.
Issues with closed lanes – inserting elemetns into a linked list randomly was nasty!
February 02, 2006
Finished Backend
Ok finished backend is but still need to do:
MOBILE (lane changing)
Tweak to
- keep to left
- lorries not to use outside lane
- appreciate pushy drivers (to move out the way)
- onramps
Frontend:
Dialogs
Control
- "build mode"
- Start/Stop
- Reset/Scale/Move etc
Output
- Graph of system (Current & AVG)
- save-to-file?
Settings
- Vehicle – aggression, politeness, headway, spawn timing etc.
January 28, 2006
Now then
OK got as far as basic AI to drive forwards and not crash into cars infront.
Problems so far:
Lane changing
Complicated to move vehicles from one lane to another in the linkedlists (threads + itterators = evil). Now just realised that i get problems when cars change into a lane with no cars behind them, or into a lane with no cars infrot of them, i.e. can only move if between two cars. Great.
January 08, 2006
After Xmas Update
Finally got around to coding now, heres the final hirachy:
Main program divided into 3 subsections:
GUI (main gui and action handlers)
Engine (main runfile, manages everything)
Entities
The Entities are related by:
JEntity (basic knowldge of position/lane, abstract methods for tick/draw)
|.......................|
JVehicle Other Ents (Divided into general/info markers/static road etc).
|
Car/Van/Truck
All ents must
Tick() – called by engine to upadate ent
Draw() – called by GUI to engine to ent to draw the object (if drawn).
——————————————————————————————————————————————————-
Development so far:
- Basic GUI to display vehicles
- Basic vehicle place holder ents which just move forwards
- Entities such as
- Road ents – a 'peice' of road for the cars to drive down. Each 800 units long. Divided into 4 200 unit subsections where ents can be placed. Onramp placeholder made. Handles kill car ents
- Spawns for cars (needs work to add variation)
- Kill Car entities
Logic so far:
- Engine timer called. Loop through all entities in list and Tick(). Loop through all Vehicles and Tick().
- Entities Tick() – do what is needed. May be generate a new Vehicle etc (or nothing)
- Vehicles Tick() – first check where we are. If we have entered a new 200 unit subsection then check if there are any new info ents to know about (speed limits/headway markers etc). Then we call Move(). If we find a CarKill then tell the engine we have.
- Engine – see how many cars have to be Killed. Pop from appropriate ques.
- Engine Draw Timer. Loop through all ents and vehicles and call Draw().
Problems:
How to Manage entities within the engine
When a new entity is created, the constructor within JEntity adds it to the engines know entities. Cars are added to a queue (there are three queues, one for each lane, when a kill signal comes it pops the queue). Entities are added to a linked list, organised by position. NEED WORK If an entity is moved its position in list needs updating! Change list to an array and just search? Speed if each car keeps searching?
Drawing Ents
Needed to add a second timer to call Draw() seperatly or else when moving/resizing window timing dies.
What to do now
- Add ability to add entities by clicking on GUI. Shouldnt be too hard (current structure makes it v. easy to add ents, just need basic code and dias to manage ents)
- Physics
- Develop Road Entity to auto generate entities
- Develop car spawns – need to ability to increase/decrase flow over time
- Ramps?!