SE450: Project Description: Program Interaction [6/16] Previous pageContentsNext page

The program should be started and run from the command line.  The UI should be based on the textUI from homework 3. The main menu should present the following options:

  1. Run simulation
  2. Change simulation parameters
  3. Exit

If the user selects option 1, a graphic window appears (if there is none already) and displays the simulation using default simulation parameters.

The user may select option 1 again to continue the simulation.

Here is a use case for how one uses option 2.

a)  The user selects option 2 from main menu.
b)  The user modifies parameters.
c)  The user selects option 15 from parameter menu, returning to the main menu.
d)  The user selects option 1 from main menu (run the simulation).
    The simulation runs using the parameters that the user entered in step (b).
    (Any previous simulation is destroyed/ignored.)

If the user selects option 2, then the program should print the following options:

  1. Show current values
  2. Simulation time step
  3. Simulation run time
  4. Grid size
  5. Traffic pattern
  6. Car entry rate
  7. Road segment length
  8. Intersection length
  9. Car length
 10. Car maximum velocity
 11. Car stop distance
 12. Car brake distance
 13. Traffic light green time
 14. Traffic light yellow time
 15. Reset simulation and return to the main menu

The user will stay with this menu until they select option 15. When option 15 is selected, any previously running simulation is destroyed and a new simulation is initialized. Control returns to the main menu.

The output when the user selects option 1 should look like this:

 Simulation time step (seconds)       [0.1]
 Simulation run time (seconds)        [1000.0]
 Grid size (number of roads)          [row=2,column=3]
 Traffic pattern                      [alternating]
 Car entry rate (seconds/car)         [min=2.0,max=25.0]
 Road segment length (meters)         [min=200.0,max=500.0]
 Intersection length (meters)         [min=10.0,max=15.0]
 Car length (meters)                  [min=5.0,max=10.0]
 Car maximum velocity (meters/second) [min=10.0,max=30.0]
 Car stop distance (meters)           [min=0.5,max=5.0]
 Car brake distance (meters)          [min=9.0,max=10.0]
 Traffic light green time (seconds)   [min=30.0,max=180.0]
 Traffic light yellow time (seconds)  [min=4.0,max=5.0]

Previous pageContentsNext page