Carpool Tunnel Banner
Project Home Page    Documentation    Download     Developer Information    CS435 Homepage    Forum    Issue Tracker

CS435 Traffic Simulation Use Cases

1 Initialization and Configuration

ID:1.1
Name:LoadGUI
Goal:The Traffic Simulation software displays the base GUI.
Success End Condition:The simulation loads the GUI, displaying the area where the simulation will take place as well as user controls.
Failed End Condition:None (always succeeds).
Primary Actor:The simulator main method.
Secondary Actor(s):None.
Trigger:The user runs the Traffic Simulator executable.
Main Success Scenario: 1. The Simulator parent window is loaded.
2. The Simulator child windows are loaded, including the simulator controls, options menu, and simulator main window.
ID:1.2
Name:StartupDialog
Goal:The user wants to start a new simulation.
Success End Condition:The simulation loads the selected map and sets the variables to the desired values and starts the simulator loop.
Failed End Condition:If the user does not specify a valid map, an error will notify the user, and allow the user to enter a valid map location.
Primary Actor:User
Secondary Actor(s):Simulator
Trigger:The user starts the Traffic Simulation Program or the user clicks the New Simulation Button or Drop Down Menu Item.
Main Success Scenario: 1. If a simulation is currently, running, the program will notify the user that the current simulation will be terminated.
2. The user can select a saved simulation to load, in which case skip to step 6. 3. The user selects the location of a valid map file.
4. The user selects a driver model.
5. The user sets simulation variables, which can be left in their default state.
6. The user presses the 'OK' button, thus loading the map, displaying the map in the GUI, and starting the simulation.
ID:1.2.1
Name:LoadPrevSimulation
Goal:The user wants to load a previously saved simulation.
Success End Condition:The user selects a valid simulation file.
Failed End Condition:The user may not select a valid simulation file or any file at all, in which case the Startup Dialog box will be displayed again.
Primary Actor:User
Secondary Actor(s):None.
Trigger:The 'Load Previously Saved Simulation' button is clicked in the Startup Dialog box.
Main Success Scenario: 1. The user browses through the filesystem.
2. The user selects a valid simulation file.
3. Further progress follows the path of Use Case 1.2.
ID:1.2.2
Name:MapSelection
Goal:The user wants to select a map to use in a new simulation
Success End Condition:The user selects a valid map file
Failed End Condition:The user may not select a valid map, or any map at all.
Primary Actor:User
Secondary Actor(s):None.
Trigger:The Startup Dialog box is displayed.
Main Success Scenario: 1. The user browses through the filesystem.
2. The user selects a valid map file.
3. Further progress follows the path of Use Case 1.2.
ID:1.2.3
Name:DriverModelSelection
Goal:The user wants to select a driver model to use in a new simulation.
Success End Condition:A driver model is selected by the user.
Failed End Condition:None (Always succeeds).
Primary Actor:User
Secondary Actor(s):None.
Trigger:The Startup Dialog box is displayed.
Main Success Scenario: 1. The user selects a Driver Model via a Listbox.
2. Further progress follows the path of Use Case 1.2.
ID:1.2.4
Name:SetSimulatorVariables
Goal:The user wants to modify the simulation variables such as simulation speed, maximum speed limit, and vehicle density.
Success End Condition:Simulation variables are changed from their default values.
Failed End Condition:None (Always succeeds).
Primary Actor:User
Secondary Actor(s):None.
Trigger:The Startup Dialog box is displayed.
Main Success Scenario: 1. The user moves the scrollbars corresponding to the variables to set the desired values. The scrollbars will prevent the user from selecting an invalid value that may cause errors in the simulation.
2. Further progress follows the path of Use Case 1.2.
ID:1.2.5
Name:LoadSimulation
Goal:The Simulation must load the cars and roads and start the simulation.
Success End Condition:Simulation variables are changed from their default values.
Failed End Condition:A user may select an invalid map file, or no map file will be selected at all, in which case the user will be notified and will be returned to the Startup dialog box.
Primary Actor:Simulator
Secondary Actor(s):GUI.
Trigger:The Start Simulation button is clicked on the Startup Dialog box.
Main Success Scenario: 1. The map file and initial cars are loaded by the simulation
2. The roads and cars are displayed by the GUI.
3. The simulation loop starts.
ID:1.3
Name:NewSimulation_SimulationInProgress
Goal:The user wants to start a new simulation after a simulation has already been loaded.
Success End Condition:The simulation loads the Startup Dialog box.
Failed End Condition:If the user does not want to lose the current simulation, the operation will be cancelled and the user will be returned to the currently running (or paused) simulation.
Primary Actor:User
Secondary Actor(s):None.
Trigger:The user clicks the 'New Simulation' button from a GUI pane or from the Options menu.
Main Success Scenario: 1. If a simulation is currently, running, the program will notify the user that the current simulation will be terminated.
2. Further progress follows the path of Use Case 1.2.
ID:1.4
Name:ResizingParentWindow
Goal:The user wants to resize the Simulation parent window.
Success End Condition:The simulation window resizes to the user's specification.
Failed End Condition:None (always succeeds).
Primary Actor:User
Secondary Actor(s):GUI.
Trigger:The user clicks and drags the mouse at the corner of the screen.
Main Success Scenario: 1. The GUI will repaint the parent window to the users's specification and resize all the child windows accordingly.

2 Running the Simulation

ID:2.1
Name:RestartSimulation
Goal:The user wants to restart the traffic simulation from the beginning, using the map and driver model specified in the startup dialog.
Success End Condition:The traffic simulation starts from the beginning.
Failed End Condition:None (always succeeds).
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user indicates through the UI that the simulation should restart from the beginning.
Main Success Scenario: 1. The initial settings for the map and the driver model are loaded.
2. Any progress made in the traffic simulation is thrown away.
ID:2.2
Name:PauseSimulation
Goal:The user wants to pause the execution of the traffic simulation.
Success End Condition:All simulator functions pause with maintained state (including graphics and modeling).
Failed End Condition:None (always succeeds).
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user indicates through the UI that a simulation pause is desired.
Main Success Scenario: 1. State is stored for all vehicles displayed.
2. The simulation is paused, and a method for resumption is displayed.
3. Further progress follows the path of Use Case 2.2.1. or Use Case 2.2.2.
ID:2.2.1
Name:SimulationResume
Goal:The user wants to resume the simulation after pausing it.
Success End Condition:The simulation restarts, following the same course of action as it would had it never been paused.
Failed End Condition:The simulation restarts, but random variables cause the model to follow a different course of action than it would had it never been paused.
Primary Actor:User
Secondary Actor(s):The simulator.
Trigger:In a paused state, the user indicates through the UI that the simulation should start again.
Main Success Scenario: 1. User indicates to the UI to resume simulation.
2. Simulation resumes.
ID:2.2.2
Name:VehicleStats
Goal:The user wants view the statistics of or information about vehicles when they are in a paused state.
Success End Condition:The GUI displays the statistics of the user-specified vehicle.
Failed End Condition:The user doesn't specify a vehicle, or the simulation isn't paused.
Primary Actor:User
Secondary Actor(s):The simulator.
Trigger:In a paused state, the user right-clicks on a vehicle.
Main Success Scenario: 1. User right-clicks on a vehicle.
2. If the simulation is paused, the GUI displays the statistics of the indicated vehicle.
ID:2.3
Name:ModifyVariables
Goal:The user wants to modify the variables governing the simulation while it is running.
Success End Condition:The simulation proceeds with new variables dictating its course of action.
Failed End Condition:The simulation proceeds with the same variables if the user specifies invalid values for the variables.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user indicates through the UI which variables should be changed.
Main Success Scenario: 1. User indicates which variable should be changed, and to what value.
2. Simulation behavior changes in accordance to new variable value.
ID:2.3.1
Name:ModifyPolitenessVariable
Goal:The user wants the simulator to behave with a different politeness variable value.
Success End Condition:The simulation proceeds with the new politeness value dictating its course of action.
Failed End Condition:The simulation proceeds with the same variables if the user specifies invalid values for the variables.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user changes the value of the politeness variable.
Main Success Scenario: 1. User indicates which value should be used for the politeness factor.
2. Simulation behavior changes in accordance to new variable value.
ID:2.3.2
Name:ModifyDeltaBVariable
Goal:The user wants the simulator to behave with a different delta b variable value.
Success End Condition:The simulation proceeds with the new delta b value dictating its course of action.
Failed End Condition:The simulation proceeds with the same variables if the user specifies invalid values for the variables.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user changes the value of the delta b variable.
Main Success Scenario: 1. User indicates which value should be used for the delta b factor.
2. Simulation behavior changes in accordance to new variable value.
ID:2.3.3
Name:ModifyTimeWarpVariable
Goal:The user wants the simulator to behave with a different time warp factor value variable.
Success End Condition:The simulation proceeds with the new time warp factor value dictating its course of action.
Failed End Condition:The simulation proceeds with the same variables if the user specifies invalid values for the variables.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user changes the value of the time warp factor variable.
Main Success Scenario: 1. User indicates which value should be used for the time warp factor factor.
2. Simulation behavior changes in accordance to new variable value.
ID:2.3.4
Name:ModifyAverageDensityVariable
Goal:The user wants the simulator to behave with a different average density variable value.
Success End Condition:The simulation proceeds with the new average density value dictating its course of action.
Failed End Condition:The simulation proceeds with the same variables if the user specifies invalid values for the variables.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user changes the value of the average density variable.
Main Success Scenario: 1. User indicates which value should be used for the average density factor.
2. Simulation behavior changes in accordance to new variable value.
ID:2.3.5
Name:ModifySpeedLimitVariable
Goal:The user wants the simulator to behave with a different speed limit variable.
Success End Condition:The simulation proceeds with the new speed limit value dictating its course of action.
Failed End Condition:The simulation proceeds with the same variables if the user specifies invalid values for the variables.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user changes the value of the speed limit variable.
Main Success Scenario: 1. User indicates which value should be used for the speed limit factor.
2. Simulation behavior changes in accordance to new variable value.
ID:2.3.6
Name:ModifyInflowVariable
Goal:The user wants the simulator to behave with a different inflow variable value.
Success End Condition:The simulation proceeds with the new inflow value dictating its course of action.
Failed End Condition:The user specifies invalid values for the variable.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user changes the value of the inflow variable.
Main Success Scenario: 1. User indicates which value should be used for the inflow value.
2. Simulation behavior changes in accordance to new inflow value.
ID:2.4
Name:ModifyView
Goal:The user wants to view the simulation differently.
Success End Condition:The simulation proceeds with the simulation being viewed in a different size or location.
Failed End Condition:The user specifies an invalid view.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user indicates through the UI that a view change is desired.
Main Success Scenario: 1. User indicates that a view change is desired.
3. Further progress follows the path of Use Case 2.4.1.
ID:2.4.1
Name:ZoomChange
Goal:The user wants to view the simulation from a closer/further viewpoint.
Success End Condition:The simulation continues to run, but all graphical elements are drawn as if closer(larger) or further away(smaller).
Failed End Condition:The user indicates a zoom value that is not appropriate.
Primary Actor:User
Secondary Actor(s):The simulator.
Trigger:The user clicks on a zoom in or zoom out button or specifies a value in a textbox.
Main Success Scenario: 1. User indicates a new zoom value to assume.
2. The simulation begins drawing objects in the appropriate size.
ID:2.4.2
Name:PanChange
Goal:The user wants to view a different part of the simulation that cannot be displayed due to map size or zoom settings.
Success End Condition:The simulation continues to run, but the a different part of the map is displayed.
Failed End Condition:The user attempts to pan off the map, or the map can fit entirely within the GUI.
Primary Actor:User
Secondary Actor(s):The simulator.
Trigger:The user clicks on a 'pan [direction]' button or indicates with the mouse.
Main Success Scenario: 1. User indicates in which direction to pan.
2. The simulation begins drawing objects only if they appear in the newly-viewable area of the simulation.
ID:2.5
Name:SaveSimulation
Goal:The user wants to save the simulation state, to view again at a later time.
Success End Condition:The state of every vehicle is saved to a file.
Failed End Condition: The save fails because the save file cannot be written due to user privileges, the save file is designated read only, or there is no space with which to save.  A warning message notifies the user and nothing is saved.
Primary Actor:The User.
Secondary Actor(s):The simulator.
Trigger:The user indicates through the UI that the simulation state should be saved.
Main Success Scenario: 1. User indicates that a state save is desired.
2. The simulation pauses momentarily.
3. The state for every vehicle is gathered, and prepared for writing to a file.
4. The state information, along with map information, is saved to a file.
ID:2.6
Name:Reverse
Goal:The user wants to run the simulation in reverse.
Success End Condition:The simulation runs in reverse.
Failed End Condition:None (always suceeds).
Primary Actor:The User.
Secondary Actor(s):None.
Trigger:The user indicates by pressing a 'reverse' button that the simulation is to be run in reverse.
Main Success Scenario: 1. The simulation runs in reverse until the start state is reached.
2. The simulation pauses at the start state if it has not been paused earlier.
ID: 2.7
Name: FramePerSecond
Goal: Maintain a minimum of 30 frames per second.
Success End Condition: Simulation runs at a minimum of 30 frames per second.
Failed End Condition: Program attempts to alter simulation and graphics to reach desired frame rate.
Primary Actor: User
Secondary Actor(s): None
Trigger: Frame rate drops below 30 fps.
Main Success Scenario:
  1. Frame rate drops below 30 fps.
  2. Program detects frame rate failure.
  3. Program changes simulation speed and graphics speed to increase performance.
  4. Frame rate is 30 fps or better.
ID: 2.8
Name: Accelerate
Goal: The car will go from one speed to another, faster speed without breaking any of the IDM requirements, colliding with another car, or running off the road
Success End Condition: The vehicle is moving at a faster speed than it previously was safely
Failed End Condition: The car doesn't accelerate and does what it was previously doing
Primary Actor: Simulation
Secondary Actor(s): Graphics
Trigger: IDM detects that accelerating is safe and desireable
Main Success Scenario:
  1. The simulator realizes that it is safe and desirable to accelerate.
  2. The simulator calculates how the car would accelerate and how much the vehicle can safely accelerate
  3. The simulator changes the information on the car
  4. The simulator sends information to the graphics to show the car moving faster
  5. When the desired speed is reached, the vehicle stops accelerating and the velocity remains constant
ID: 2.9
Name: Decelerate
Goal: The car will go from one speed to another, slower speed without breaking any of the IDM requirements, colliding with another car, or running off the road
Success End Condition: The vehicle is moving at a slower speed than it previously was safely, or it has stopped altogether (deceleration to 0 km/h)
Failed End Condition: The car doesn't decelerate and does what it was previously doing
Primary Actor: Simulation
Secondary Actor(s): Graphics
Trigger: IDM detects that decelerating is desireable
Main Success Scenario:
  1. The simulator realizes that it is safe and desirable to decelerate.
  2. The simulator calculates how the car would declerate and how much it should decelerate
  3. The simulator changes the information on the car
  4. The simulator sends information to the graphics to show the car moving slower or stopping
  5. When the desired speed is reached, the vehicle stops decelerating and the velocity remains constant
ID: 2.10
Name: ChangeLanes
Goal: A vehicle on the roadway wants to change lanes
Success End Condition: The vehicle is in the lane that it wished to turn into
Failed End Condition: The vehicle does not change lanes
Primary Actor: Vehicle
Secondary Actor(s): Simulation, Graphics
Trigger: The MOBIL equation in the simulator determines that it is desirable for a car to change lanes due to one lane being preferable
Main Success Scenario:
  1. The MOBIL equation in the simulator determines that it is desirable for a car to change lanes
  2. The vehicle makes sure that there is adequate space in the adjacent lane to change lanes. If not, the lane changing process terminates, and the vehicle continues on its former path
  3. The simulation temporarily changes its information to indicate that the car occupies both lanes
  4. The simulation sends the information to the graphics module that it needs to paint the car in the new lane and remove the car from the old lane
  5. The graphics module paints the car in the new lane and removes the car from the old lane at the next timestep.
  6. The graphics module sends information to the simulator that the painting is done
  7. The simulator removes the information about the vehicle being in the old lane, reflecting that it now fully and only occupies the new lane
ID: 2.11
Name: ChangeLanesDueToObstacle
Goal: A vehicle on the roadway wants to change lanes
Success End Condition: The vehicle is in the lane that it wished to turn into
Failed End Condition: The vehicle does not change lanes and slows to a stop in front of the obstacle
Primary Actor: Vehicle
Secondary Actor(s): Simulation, Graphics
Trigger: The MOBIL equation in the simulator determines that it is desirable for a car to change lanes due to one lane being preferable
Main Success Scenario:
  1. The MOBIL equation in the simulator determines that it is desirable for a car to change lanes due to an oncoming obstacle
  2. The vehicle makes sure that there is adequate space in the adjacent lane to change lanes. If not, the lane changing process terminates, and the vehicle slows to a stop in front of the obstacle
  3. The simulation continues trying to change lanes, as described in Section 2.10

ID: 2.12
Name: HandlingIntersections
Goal: A vehicle on the roadway should successfully navigate an intersection
Success End Condition: The vehicle has gotten past the intersection has has safely moved to its new road segment
Failed End Condition: None (always succeeds)
Primary Actor: Vehicle
Secondary Actor(s): Simulation, Intersection
Trigger: A vehicle detects that it is approaching an intersection
Main Success Scenario:
  1. The vehicle detects that an intersection is near
  2. The vehicle decelerates to a stop as described in Section 2.9
  3. The simulator informs the intersection that a vehicle is stopped at it
  4. The intersection determines when it is safe and acceptable for the vehicle to navigate it
  5. The intersection randomly chooses the car's destination road segment from among all possible road segments that do not have permanent blockages.
  6. The intersection signals the simulator that the vehicle can go.
  7. The simulator accelerates the vehicle in the direction it needs to go as described in Section 2.8
  8. The vehicle information is passed to the new road segment that the vehicle is on
ID: 2.13
Name: FollowCar
Goal: The user wants to follow a specific vehicle no matter where it goes on the map.
Success End Condition: The program will pan automatically to follow the selected vehicle.
Failed End Condition: None (always succeeds)
Primary Actor: User
Secondary Actor(s): None
Trigger: User indicates desire to follow a specific car in the simulation.
Main Success Scenario:
  1. The user pauses the simulation by clicking the "Pause" button.
  2. The user will right click on a vehicle and select "Follow Vehicle" from the drop down menu. If the user had already selected a vehicle to follow, that vehicle will no longer be followed.
  3. The vehicle will change color to make it stand out.
  4. The user will resume the simulation by pressing the "Play" button.

3 Termination

ID:3.1
Name:Exit Program
Goal:The user wants to exit the Traffic Simulator Program.
Success End Condition:The Traffic Simulator Program exits.
Failed End Condition:If the user does not want the currently running (or paused) simulation to be lost, the program will not terminate execution.
Primary Actor:User
Secondary Actor(s):None.
Trigger:The user clicks the 'X' at the top right corner of the Traffic Simulator parent window, or clicks the 'Exit' button in the Options menu.
Main Success Scenario: 1. If a simulation is currently, running or paused, the program will notify the user that the current simulation will be terminated.
2. The user will also be prompted to save the current simulation.
3. The simulation will terminate.
ID:3.1.1
Name:ExitLoadMap
Goal:The user wants to exit the Traffic Simulator Program while a map is loading.
Success End Condition:The Traffic Simulator Program exits.
Failed End Condition:If the user does not want the newly created simulation to be lost, the program will not terminate execution.
Primary Actor:User
Secondary Actor(s):None.
Trigger:The user clicks the 'X' at the top right corner of the Traffic Simulator parent window.
Main Success Scenario: 1. Once the map has loaded and the simulation is ready to start, the program will inquire if the program is to be terminated.
2. Further progress follows the path of Use Case 3.1.
ID:3.1.2
Name:ExitSaveSim
Goal:The user wants to exit the Traffic Simulator Program while the current simulation state is being saved.
Success End Condition:The Traffic Simulator Program exits.
Failed End Condition:None. (Always succeeds).
Primary Actor:User
Secondary Actor(s):None.
Trigger:The user clicks the 'X' at the top right corner of the Traffic Simulator parent window while the simulation is saving.
Main Success Scenario: 1. Once the simulation has been saved, the program will inquire if the program is to be terminated.
2. Further progress follows the path of Use Case 3.1.

4. Requirements Changes

In creating the Use Cases document, we found that several changes could have been made to our requirements document. First, the high level design specified that maps should be loaded on start. It also specified that the driver model should be modified while setting up and running the simulation. We also did not address the issue of fast forwarding. All of these issues were addressed in the Use Cases document, since the user will directly interact with these issues, but were not in the Requirements Document. Furthermore, we would have been a little more detailed in the requirements document about how the GUI was to function, such as describing the dialog box which starts a new simulation and the layout of the GUI. Another important issue in the requirements document would have been to address error handling in greater detail. Use cases seem to play a great role in determining how the user could generate errors. Once most possible user errors have been determined, then the requirements could be modified to address them.

Valid CSS!
Valid HTML 4.01!