Purpose: Finalize diagrams and build the final version of your system
with an event-driven, graphical front end. Produce a manual for your system.
Points: Writeups: 10; Manual:
15; System: 35
Due: Writeups: Beginning of class on April 23, 2007; Manual: Beginning of class on April 30, 2007
Final Version: 11:59 PM on
May 3, 2007, using the turnin script. Late submissions will not be accepted.
Description: For this iteration, you will turn in final versions of all use
cases and diagrams, create a component diagram for your system, and produce the
final version of your system. You will also submit a manual detailing use of
the features of your system
In this iteration, your simulator will progress to a
final version as specified in the Term Project document. There will be clearly
defined administrator and experimenter functions, and you will design and
implement a graphical front end to interact with the user. You will also create
a component diagram, and submit final versions of all other printed work.
Use QT or another GUI designer to implement a set of
graphical front ends for your system. All interaction with the user should now
occur via the interfaces you created.
For this iteration vehicle speed should be taken
into account, and scaling should be used so that realistic delays can be
factored into the simulation. Use ratios to enable your system to provide a
realistic simulation. For example, suppose blocks are each 1056 feet (5 to a
mile), and traffic lights all operate on a one minute cycle. A vehicle traveling 30 MPH should require 12
seconds at full speed to travel from one intersection to the next. Suppose each
light has 35 seconds green on the street being traveled. Then, if you have a
ratio of 1 second in the simulator equal to one minute of real time, your
thread can suspend for 0.2 seconds between intersections and some percentage of
a second if it hits a red light.
Intersections should run in their own threads, or at
least in a separate thread. When a light turns green, all Vehicles on its queue
should be removed. You will suspend execution of threads as vehicles enter an
intersection’s queue, and restart them when removed. pthread conditions should
be used to accomplish this See the condition variable examples for guidance.
Your report should provide some analysis. In
particular, for any trial, a report will minimally include the shortest paths,
by distance, and by your measurement of time.
Notes:
·
In
QT, you must edit the makefile and add the –lpthread to the linking command by
updating the library list.
·
All
diagrams are to be marked with the date of last update.
·
Test
your system and turnin report files in addition to the code so reports can be
viewed.
·
If
you work with a 1:60 ratio on time, stop signs should probably delay a vehicle
that has arrived at the sign by 0.05 seconds (simulating 3 seconds). Of course,
if there is a line at the stop sign, a vehicle will wait 3 seconds for each
vehicle ahead of it.
·
It
may be that the time to dequeue and restart threads will be a good simulation
of the time to get out of an intersection after stopping.
·
You
should use pthread_cond_destroy to remove condition variables after use, and
pthread_mutex_destroy for mutexes..
·
Consider
varying the block distances between north-south and east-west streets.
·
The
issue of whether vehicles can pass one another may need to be addressed, at
least via an assumption. Note in your manual how this is approached, in a
realistic manner.
·
You
may need to further update the Vehicle class (and maybe its subclasses) to
handle the traversal. In particular, vehicles may need to have member functions
that can be called to suspend the vehicle’s thread (via the condition).
·
Proper
documentation and style is expected. The application must be modularly
designed.
Deliverables:
Write-ups:
Beginning of class on April 23, 2007
Manual: Beginning of class on April 30, 2007
Final Version: 11:59 PM on May 3, 2007, using the turning script. Turn
in all code files, a makefile, and data file(s). Your manual should suffice in
place of a readme. The makefile must build an executable named i3.