PACIFIC COMP 155 - Designing and Running Simulation Experiments

Unformatted text preview:

COMP/EMGT 155 Assignment 1 Assignment 1: Designing and Running Simulation Experiments Due Date: Monday September 8 The purpose of this assignment is to begin to gain experience designing and analyzing experiments using a computer simulation. You’ll start with a working simulation of an artificial ecosystem. Although you will need to be able to run Python programs, no explicit coding (beyond changing parameter values) is required. Assignment: Design, run and analyze experiments to prove or disprove the following hypotheses: • Hypothesis 1: If there is no sun, all life in the system will die out. • Hypothesis 2: The population oscillations of the system (using the default parameters) continually increase in amplitude. As a result, the plant population will eventually reach zero, after which, all life in the system will die out. • Hypothesis 3: If the death rate of animals is at least twice the reproduction rate of animals, the animals will quickly die off. • Hypothesis 4: The peak number of plants is inversely proportional to the sun period. • Hypothesis 5: The period of oscillation of the plant and animal populations are both directly proportional to the sun period. • Hypothesis 6: The seeding of plants has no significant impact on the behavior of the system. What to submit: Compile a report indicating your conclusions regarding the stated hypotheses. For each hypothesis, include a brief description of your experiments as well as any assumptions made. Also include sufficient data and/or data plots to support you conclusions. Your report should be a single document in Word or PDF format. Teams: You may work in teams of up to three people to complete this assignment.COMP/EMGT 155 Assignment 1 Code Structure: Files you’ll need to edit: • PASimParameters.py: Defines the parameters which control the simulation. This is the only file that requires modification to complete this assignment. Files you’ll need to execute: • runPASim.py: This is the main program, which creates and runs the simulation. To run an experiment, simply execute this program. The program shuts down on any mouse click within the graphics window. • plotPASimResults.py: Run this program to plot the data from your last experiment. Reads files animals.txt, plants.txt and sun.txt. Files you won’t need to touch: • PASimWorld.py: Defines the PASimWorld class, which holds the simulation logic. It also has code to update the user interface and to store results. • PASimCell.py: A class to record the life in one cell. • Grid.py: A data structure to hold all the cells. • CellGraphics.py: Code to draw the cells in the window. Files generated by the simulation: These files are created when you run a simulation. They are read when you create plots of the results. • animals.txt: a record of the total number of animals in the world at each step in the simulation. • plants.txt: a record of the total number of plants in the world at each step in the simulation. • sun.txt: a record of the sun strength at each step in the simulation. Configuration Options: These two parameters can be modified to change how the simulation and plotter programs behave. Neither has any effect on how the simulation itself evolves. sim_draw_ratio: You can modify the execution speed of the simulation by changing the value of sim_draw_ratio in the file runPASim.py. This value set the number of simulation steps that are taken between each update of the graphical display. The default value is 1, which means that you will see all changes to the world. If you raise this number to something greater than one, you will only see some of the steps in the simulation. Since the graphics update is significantly slower than the simulation logic, raising sim_draw_ratio can speed up the simulation considerably. plants_and_animals_on_same_plot: You can change this value in file plotPASimResult.py to determine whether the plant and animal populations are presented on a single plot or on separate plots.COMP/EMGT 155 Assignment 1 Simulation Parameters: These parameters control the evolution of the simulated ecosystem, as defined by the simulation logic. Your primary means of carrying out experiments will be to modify these parameters before each simulation run. These parameters are defined in file PASimParameters.py. • max_animals_per_cell: Caps the number of animals allowed in a single cell. Default: 255 animals. • max_plants_per_cell: Caps the number of plants allowed in a single cell. Default: 255 plants. • migrate_level: The minimum number of animals that must be in neighbor cells to induce migration into the current cell. Default: 20 animals. • migrate_rate: Percentage of neighboring animals who will move to current cell, assuming that migration is induced. Default: 20%. • starve_rate: Percentage of animals that will die if there are no plants in the current cell. Default: 50%. • death_rate: Percentage of animals that will die (independent of starvation). Default: 10%. • reproduction_rate: Percentage of animals that will reproduce. A reproducing animal creates one new animal. Default: 10%. • migration_attraction_level: Minimum number of plants that must be in current cell to induce migration of animals from adjacent cells. Default: 20 plants. • seed_level: Minimum number of plants needed in neighboring cells to induce seeding in current cell. Default: 30 plants. • seed_rate: Number of new plants created through seeding (assuming seeding is induced) as a percentage of neighboring plants. Default: 5%. • consume_rate: Number of plants eaten by animals in current cell. Default: 0.15 plants/animal. • growth_rate: Number of new plants grown for each unit of sun. Default: 0.05 plants / sun unit. • sun_period: Number of simulation steps in one sun cycle (one “year”). If this is zero, there will be no sun at all. Default: 20 steps / cycle.COMP/EMGT 155 Assignment 1 Simulation Logic (Model): The new populations of animals and plants in a cell are computed from: Logic for sun strength: Logic for animal population: // If there are sufficient plants in this cell to attract animals from adjacent cells, // and there are sufficient animals in adjacent cells to induce migration, // add animals to this cell. if ((pc > migration_attraction_level) and (an > migrate_level)): ac  ac + an * migrate_rate // If there


View Full Document

PACIFIC COMP 155 - Designing and Running Simulation Experiments

Download Designing and Running Simulation Experiments
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Designing and Running Simulation Experiments and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Designing and Running Simulation Experiments 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?