In this lab, modify the Museum simulation which is included in the SimulationsPkg.2Oct.cs found in Chapters 23 and 24 of the Smalltalk-80 textbook. We will mo dify the Museum to have more people in the museum than just visitors. Add volunteers and staff.
Your simulation should keep track of the number of people in the museum at each time interval, where the number of people includes staff, volunteers, and visitors. Have your simulation be able to output the maximum number of people at any time. Hint: Either during the enter: method or on the simulation object's initialize: method, increment a count of people. At exit:, decrement the number of people.
Also, be careful of the syntax used for some of the classes in the Simulation package. For the entry of people, you may use the following methods:
scheduleArrivalOf:at:
scheduleArrivalOf:accordingTo:
scheduleArrivalOf:accordingTo:startingAt:
Make sure you understand how these work and what can and cannot be passed to them. The statistical information should be included in the package, so you don't have to worry about that. Look at how the functions are implemented in the other simulation clas ses to get an idea of how to do it.
To run the simulation provided, use the code below:
| aSimulation |
aSimulation := Museum new startUp.
[aSimulation time < 480] whileTrue: [aSimulation proceed]. "480 minutes, all day"
Transcript show: 'Maximum: ', (aSimulation maximum printString) ; cr.
Note: If Squeak is stalling on the whileTrue: loop, you can exit it by pressing CTRL-Break simultaneously. The Break key is the right-most key on the top-most keyboard line.
Fileout your code as usual.If you're working from home only make sure you have previously filed in CrLfFileStream.cs and set it up as your concreteStream - se e Lab2: Debugging for details.
You should see all of your assignments and their respective grades. At the top of the page, right under the banner, is a link that should allow you to turnin an assignment. Choose the assignment and make sure to copy and paste your code into the lower tex t area (called "Work Content"). If there are any special comments or other things needed for the assignment, you can type that into the top text area (called "Documentation"). When done, hit the Create button, and you're done!
This will be the turnin procedure for the rest of the quarter, and it will also allow you to see your grades as soon as they are entered by your TA.
When turning in an assignment, you have to put some text in both text fields. The code field will obviously have code in it. The documentation field can be filled in with a space. If you don't put something in both fields, you will get an error and your work will not be turned in.
News Page | CS2390 Sp'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 5/4/98; 9:56:48 AM