18-649 Project 1 Simulation Exercise

(Project 1 part B)

Please submit all project-related correspondence {short description of image}


Changelog:  (see main page)

Simulation Exercise:

Test the elevator system.

The purpose of this assignment is for you to become familiar with the simulation framework.  For this assignment you will not be working with the fully functional elevator, but rather you will see how a sample module works within the simulation framework.  You will need to perform the following steps:

  1. Read the simulation overview.
  2. Download the simulator code from the codebase download page.  Unpack into a folder in your AFS space.
  3. Download TestLight.java and add it to the simulator.elevatorcontrol package. Study the file and try to understand what it does.  More information is provided in the testlight summary.

  4. There are two locations in TestLight.java  marked with the word “TODO:”.  Modify TestLight.java according to these instructions:

    1. On line 212, comment out the TODO line and add the code needed to set the physical and network light messages to on/true
    2. On line 219, comment out the TODO line and modify the if statement with the logic needed to effect the tradition TL.T.5 according to the testlight summary.
  5. Compile the rest of the simulator using the makefile. Execute “java simulator.framework.Elevator” to see the command line parameters for the simulator.

  6. Run the unit test on the TestLight module:

    1. Write a configuration file that instantiates the TestLight module and no other module.  Instantiate the the 4th floor, front hallway, down direction instance with a period of 100 milliseconds and the verbose option set to TRUE.  You can read more about these files in the command line summary and in the comments in TestLight.java

      If you are having trouble with the configuration file, please check the output from part 5, or refer to the .cf files from the pepsi machine example (eg). (The portfolio will be discussed in lecture 5, but the .cf files may still prove a useful guide)

    2. Download and study defines.mf and  testlight_01.mf message injector files.  See if you think it is correctly testing the statechart.

    3. Run the simulator with the .cf file you wrote and testlight_01.mf message injector file.   Be sure you save all the output!  Hint:  in the BASH shell, use '&>' to redirect both stdout and stderr to a single file. Also, as noted in the simulator documentation, you can use the -head command line parameter to automatically add the header information to generated files.

    4. Study the output you saved.  Check to make sure that the assertions are all true.  Also look at the verbose output from TestLight and see if the correct state transitions occur.
  7. Run an acceptance test using basicpass.pass. Configure the simulator to run with the gui enabled and for at least 400s.  The simulation may take a little while to complete, but observe how the elevator behaves.  You may be asked questions about the simulation in the first group meeting.  Be sure you save the elevator.stats output file.

See the main project page for a list of deliverables and their point values.


Back to Project 1