2. Fix closed lanes. Act strange on reset.
March 01, 2006
February 28, 2006
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?
February 21, 2006
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
Output from graph (csv?)
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
Ok finished backend is but still need to do:
MOBILE (lane changing)
- keep to left
- lorries not to use outside lane
- appreciate pushy drivers (to move out the way)
- "build mode"
- Reset/Scale/Move etc
- Graph of system (Current & AVG)
- Vehicle – aggression, politeness, headway, spawn timing etc.
January 28, 2006
OK got as far as basic AI to drive forwards and not crash into cars infront.
Problems so far:
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
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)
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).
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().
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?
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)
- Develop Road Entity to auto generate entities
- Develop car spawns – need to ability to increase/decrase flow over time