📄 mbshelp.html
字号:
<html><body><a name="Top"></a><center> <h1>Marine Biology Simulation Program:<br> Using the Graphical User Interface</h1></center><p>The Advanced Placement® Marine Biology Simulation case study is a simulation program designed to help marine biologists study fish movement in a small, bounded environment such as a lake or bay. </p><p>The simulation program is distributed with a graphical user interface (<code>MBSGUI</code>), described in this help file. Topics include:</p><ul> <li>Choosing an initial fish configuration file. (<a href="#Open">Open</a>) </li> <li>Running the simulation for one timestep or continuously. (<a href="#Step">Step/Run</a>)</li> <li>Saving the state of the simulation for future use. (<a href="#Save">Save</a>)</li> <li>Creating a new environment and populating it with fish. (<a href="#Create">Create</a>)</li> <li>Seeding the random number generator to get repeatable results. (<a href="#Seed">Seed</a>)</li> <li>Viewing large environments. (<a href="#View">View</a>)</li> <li>Customizing the graphical user interface. (<a href="#Advanced">Advanced Features</a>)</li></ul><table width="90%" align="center" border="1"><tr> <td> <h4><i>Notes:</i></h4> <ol> <li>This document does not describe how to compile and run the Marine Biology Simulation program, which depends on the specific type of computer and software you are using. Information on compiling and running the program on a number of common platforms can be found in the <code>ExecutionInformation</code> folder under the main <code>JavaMBS</code> folder. The actual case study document can be found in the <code>Narrative</code> folder.</li> <li>You may run the Marine Biology Simulation program using the graphical user interface described in this document or using an interface provided from another source. The Advanced Placement exam will not test students on the specifics of the graphical user interface. See the Introduction to the case study document for more information on what may be covered on the exam.</li> </ol> </td> </tr></table><h3><a name="Open"></a>Opening an existing initial configuration file</h3> <p> The Marine Biology Simulation (MBS) case study is distributed with a number of initial configuration files in the <code>DataFiles</code> folder, including the <code>fish.dat</code>, <code>manyFish.dat</code>, and <code>onefish.dat</code> files mentioned in Chapter 1. (You may not see the <code>.dat</code> extensions if your computer environment doesn't show them automatically.) To choose an initial configuration file: </p><UL> <LI>Select the "Open environment file..." item from the File menu. <LI>In the dialog box (window) that comes up, select the configuration file you want (such as "<code>fish.dat</code>") from the <code>DataFiles</code> folder. <p> The dialog box will come up in the program's current execution folder, so you will probably have to navigate to the <code>DataFiles</code> folder to find the initial configuration files. Depending on how and where you are running the program, its current directory may be the <code>JavaMBS</code> folder or one of the other folders under it, such as the <code>Code</code> folder, the <code>ExecutionInformation</code> folder, or a project folder under either <code>Code</code> or <code>ExecutionInformation</code> (or possibly some other folder altogether). <code>DataFiles</code> is another of the folders under the <code>JavaMBS</code> folder, so you will need to first navigate to the <code>JavaMBS</code> folder and then to the <code>DataFiles</code> folder. Then select the configuration file you want to open. <p>The configuration files in the <code>DataFiles</code> folder represent bounded environments. If you wish to read in a configuration file for an unbounded environment (see Chapter 5 of the MBS case study), navigate to the <code>UnboundedEnvDataFiles</code> folder in the <code>DataFiles</code> folder and select a configuration file from there. </UL><p>The program will display the environment for the configuration file you chose as a rectangular grid of locations, with fish in the locations specified in the initial configuration file.</p><p><a href="#Top">(Go to top of help file.)</a></p><h3><a name="Step"></a>Running the simulation</h3> <p>You can run the Marine Biology Simulation program one timestep at a time, or continuously for many timesteps.</p><ul> <li><b>To run the program one step at a time,</b> click on the Step button. Each time you click on the Step button, the program will run one timestep in the simulation, with fish moving from cell to cell in the grid. See Chapters 1 and 2 of the MBS case study for more information about how fish move in the simulation.</li> <li><b>To run the program continuously for many timesteps,</b> click on the Run button. Click on the Stop button to stop the simulation. You can then click on either Step or Run to continue the simulation for one more timestep or for many timesteps. You can adjust the speed of the simulation by dragging the indicator on the Slow/Fast slider to the left or right. <p>By default, the Run button will cause the simulation to run indefinitely, until you select Stop. You can also run the simulation for a specific number of steps. If you choose "Use fixed number of steps..." from the Run menu, you will be prompted for a certain number of steps. If you specify a number and click on OK, you will notice the label on the Run button change. For example, if you chose 10 steps, the button will read "Run for 10 steps." When you click on the button, it will run for 10 timesteps, or until you select Stop. If you choose "Prompt for number of steps" from the Run menu, the label on the Run button will change to "Run..." and you will be prompted for the number of steps every time you click on it. Again, the program will run that number of timesteps unless you select Stop. To return to running the simulation continuously, choose "Run Indefinitely" from the Run menu.</p> </li></ul><p><a href="#Top">(Go to top of help file.)</a></p><h3><a name="Save"></a>Saving the current state as a new configuration file</h3> <p>At any time while running the Marine Biology Simulation program, you can save the current state of the environment as a configuration file. You can then use this file later as an initial configuration file for a new run of the simulation, to continue the current run of the simulation, or to compare results from a different run of the simulation (see Chapters 3 and 4 of the MBS case study for more information about <i>regression testing</i>).</p><UL> <LI>Select "Save environment as..." from the File menu. <LI>A dialog box will come up in the program's current execution folder. Navigate to the folder where you want to save the new configuration file. <LI>Give the new file a name, such as <code>myConfigFile.dat</code>. ( If you don't specify a <code>.dat</code> extension, the program will add it. Again, you may not see the <code>.dat</code> extension if your computer environment doesn't display file extensions.) If you try to save to a file that already exists, the program will verify that you wish to replace the existing file. </UL><p><a href="#Top">(Go to top of help file.)</a></p><h3><a name="Create"></a>Creating and populating a new environment</h3> <p>You can use the graphical user interface for the Marine Biology Simulation program to create new environments in several ways. You can open an initial configuration file, run it for several timesteps, and then save that environment to a file. (See "<a href="#Open">Opening an existing initial configuration file</a>," "<a href="#Step">Running the simulation</a>," and "<a href="#Save">Saving the current state as a new configuration file</a>.") You can also create a new environment from scratch, specifying the size of the environment and the initial locations and directions of all the fish in it. Or, you can edit the current state of an environment, adding and removing fish. This section describes creating new environments and editing environments.</p><h4>Creating a new environment:</h4><UL> <LI>Select "Create new environment..." from the File menu. <LI>Choose the environment type. For Chapters 1 - 4 of the Marine Biology Simulation case study, you can use the default "BoundedEnv" choice without doing anything. For Chapter 5, choose whichever environment type you want to create. The choices will be the "BoundedEnv" and "UnboundedEnv" types, unless you specify additional environment types in the <code>main</code> method of the <code>MBSGUI</code> class (see "<a href="#Advanced">Customizing the graphical user interface</a>"). <LI>If you choose the "BoundedEnv" environment type, you will be prompted to specify the number of rows and columns in the bounded environment. The program will use the default values shown in the text fields if you do not change them. <LI>Click on the Create button. <LI>Add and remove fish as described below. </UL><h4>Editing an existing environment:</h4><UL> <LI>Select "Edit environment..." from the File menu. <LI>Add and remove fish as described below. (You cannot change the type or size of the environment using the "Edit environment..." feature.) </UL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -