Purpose: Create more specific diagrams including collaboration and sequence
diagrams for the system. Upgrade the prototype from Iteration 1 to an alpha
version.
Due: Writeups: Beginning of class on March 26, 2007
Alpha: 11:59 PM on April 4,
2007, using the turnin script. Late submissions will not be accepted.
Description: For this iteration, you will prepare several diagrams representing
use case realizations for the traffic simulator and produce an alpha version.
In this iteration, your simulator will progress to
running pretty much a full simulation as specified in the Term Project
document. Also, the split between administrator and experimenter is to take
shape by implementation of a text based layout creation (and storage) tool. To
achieve these ends, you should create object interaction diagrams, along with
producing updates from Iteration 1. Specifically, you should submit the
following:
From Iteration 1:
Ø Class diagrams, updated to
currency.
Ø A use case diagram showing
all use cases and all actors. Also, any use cases that are updated
Ø Info on format of a street
layout on disk. Submit even if submitted last time
For Iteration 2:
Ø Realizations of use cases Create
a Street Layout and Run a Simulation. Create each of the following
diagrams for each of these use cases, and one other of your choice:
o
Collaboration
diagram
o
Sequence
diagram
o
State
Diagram
You will implement the simulation to input the
starting point and destination, and the number of vehicles, and run them
through the layout simultaneously by using threads to create a lightweight
process for each one. Each Vehicle will output its results to a file named results.txt,
in a well labeled manner. This file will be created if it doesn’t exist, or
updated otherwise. Each Vehicle will retain timestamp info for its starting and
finishing times off the system clock. Time is measured as the difference of
those times, and also by number of intersections in the traversal.
As multiple vehicles will be traversing the layout
simultaneously, provisions must be made to ensure that the data written to
results.txt is not garbled due to concurrent threads writing to results.txt
simultaneously. This will be accomplished by using a mutex to allow only one
thread to modify the file at any time. To maximize system throughput, each
thread will write its results, all at once, upon completion.
Notes:
·
Submit
any updates to the diagrams from Iteration 1. Make sure that these updates are
clearly labeled as such. Also, submit updated class diagrams.
·
Be
sure each thread has its own local data for recording timestamps and results.
·
You
may need to further update the Vehicle class (and maybe its subclasses) to
handle the traversal.
·
Linker
libraries must be specified when using threads. Your linker command must
include the appropriate library: –lthread or –lpthread, depending on which
thread library you are using.
·
Proper
documentation and style is expected. The application must be modularly
designed.
Turnin:
Writeups: 6 PM March 26,
2007
Alpha: 11:59 PM, April 4, 2007. Turn in all code files, a makefile, and
data file(s). You may also submit a readme. The makefile must build an
executable named i2.