# I need help with a python/jupyter project

Simulation Model

To explore the consequences of establishing habitat corridors between the patches, you decide to build a Python framework that will allow you to simulate the movement of individuals through time (simulated as discrete steps) and track what happens to the populations. Your framework will include three types of classes: an Individual class, a Population class, and a Landscape class. Individuals exist in populations, and populations exist in a landscape. In each time step of your simulation, individuals can stay in the population where they started, or move to a new population. The probabilities that individuals stay or leave are stored in a table called a dispersal matrix (more detail below). Individuals need to (at a minimum) have a phenotype attribute, populations need to (at a minimum) have a list of Individuals, and Landscapes need to (at a minimum) have a list of Populations and a dispersal matrix. The dispersal matrix consists of the probabilities that an individual disperses between populations, or stays in place, each time step. For Warbling Babblers, these probabilities correspond to their probability of moving in a week (Fig. 1). If an individual moves from one population to another, you should remove it from the list of individuals in the population where it started, and add it to the list of individuals in the population where it went. There are multiple ways to use the probabilities in the dispersal matrix to decide if an individual moves in each time step, but one function you may find helpful is random.choices(â¦) from the random module. Population constructors should create a new list for individuals in that population, and Populations should have methods to add and remove individuals, as well as to calculate and print the frequency of phenotypes among individuals. Landscape constructors should create a new list for the populations in that landscape, and Landscapes should have a method that uses the probabilities in the dispersal matrix to determine if an individual moves or stays each time step. Either the Population or Landscape constructors should set the starting population sizes. The total number of individuals across all populations should stay constant, but individual populations may change size.

All three classes may contain other attributes or methods as you see fit! Some elements of this framework are similar to recent assignments, so you may find inspiration in the code you wrote earlier. One additional piece of advice is to test each classÊ¼s constructor and methods as you write them. When simulations begin, all the individuals in a population should have the same phenotype. As individuals move back and forth between populations through the time steps (weeks), you will want to track the trajectory of phenotype frequencies and population sizes. To do this, you will need to write (at least one) function to create these plots. This function can either be a method of one of your classes, or it can be independent. I recommend overlaying phenotype frequencies or population sizes for different populations on a single plot for easy comparison. For example, you might create one plot for phenotype frequencies that shows three different lines for three different populations, and another, similar plot for population sizes.

## Related Questions

Similar orders to I need help with a python/jupyter project
11
Views
0
Given a number n, each iteration assign n as f (n). count the number of iteration until n = 1.
IE5881 National University of Singapore Online Judge assignment...
25
Views
1
Python - Homework
Running perfectly - if is possible 10/10 on Pylint....
35
Views
0
highschool python assessment
need this done by jan 25 just write the code in python and send me video or screenshots they should be detailed pls...
15
Views
0