EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Python代写
您的位置: 主页 > 编程案例 > Python代写 >
代写Python:Python模型题目实现:A Dolphin Population Model - Python代写
发布时间:2021-07-25 15:03:37浏览次数:
A Dolphin Population ModelBuild a model for a dolphin population over 150 years. Model Assumptions and Input:•Dolphins live for an average of 35 years, with a standard deviation of σ = 5years.•Dolphins procreate starting at the age of 8 until death. They produce no more than 1 calf every 5 years (assuming gestation length iszero).•No dolphins can procreate with another that share the same set of parents and must procreate with other dolphins that are within 10 years of their own age and of the opposite sex. Male and female calves are equally likely: P(male) = 1 – P(female) =0.5.•No new calves can be named the same as any other dolphin, dead oralive.•Start with an initial population of 4 dolphins, two females and two males, all at the age of0.Part I: Preparatory Steps1.Use a webservice to make two data files with a unique name in each line, one for themales and the other the females. A good place tostart:http://www.prokerala.com/kids/baby-names/boy/page-1.htmlandhttp://www.prokerala.com/kids/baby-names/girl/page-1.htmlDownload lists of male and female names from the above source. Write a function that retrieves~ 7,500 names for both the males and females and save them in two separate data files(usually, with the extension .dat). At the moment this website has ~100 names per page, which means you need to download 75 pages worth ofnames.2.Use the name data files made in the above step, write a name generating function. You should useyieldratherthan returninthis functionsothat eachtimeitis called,itwill returnthe next name. This function should take sex as an inputparameter.When you run out of unique names, you are allowed to add a middle name. The middle name can be a random string of ten letters. (No, we don’t care that much about middle names, not those for dolphins anyway!) You can do a quick calculation and convince yourself that, with middle names generated this way, the probability of having two dolphins with the samename is extremely low.3.Create a class Dolphins()that should include at least the following attributes:-name-sex-age#initializedto0ofcourse.-mother-father-years_since_procreation-death#Thatis,howlonganindividualdolphinlives#anditshouldfollowaGaussiandistribution.Besides init it should have two othermethods:-age_recordwhich keeps track of the dolphin s age and years since procreation, and determines when the dolphin dies.and-request_procreationwhich determines whether this dolphin and another can procreate.Part II: Model OutputWrite a main program called dolphin_pop_model.pythatA) Finds the average number of living dolphins and the standard deviation for each of the150 years. You need to evolve the dolphin population at least 10 times to find the mean and the standard deviation. While running the trials, you should print out the information for the population every 25 years, for each trial. At the one hundred year mark, also reportthenumber of living dolphins at the end of that year and the total number of births since the very beginning of the trial, like this:TrialNo.7##################################################enteringyear0with4dolphins,with0breeding.##################################################enteringyear25with14dolphins,with5breeding.##################################################enteringyear50with39dolphins,with13breeding.##################################################enteringyear75with104dolphins,with35breeding.##################################################enteringyear100with316dolphins,with114breeding.atyear100,thereare330livingdolphins.therehavebeen430births,intotal.##################################################enteringyear125with1052dolphins,with381breeding.##################################################atyear149,thereare3225livingdolphins.**************************************************TrialNo.8##################################################enteringyear0with4dolphins,with0breeding.##################################################enteringyear25with13dolphins,with4breeding.##################################################enteringyear50with28dolphins,with15breeding.##################################################enteringyear75with84dolphins,with24breeding.##################################################enteringyear100with267dolphins,with93breeding.atyear100,thereare280livingdolphins.therehavebeen354births,intotal.##################################################enteringyear125with904dolphins,with316breeding.##################################################atyear149,thereare2924livingdolphins. Note that each trial ends at the end of year 149, since we start at year 0.Finally, plot the average population size vs. year with the “error snake” around the mean. (the red band around the curve in the plot below).Suggestion: use matplotlib.pyplot.fill_between() — see documentation for matplotlib.pyplot. You need to label the axes and give the plot an appropriate title. Save it as population_growth.pdf.Below is an example:B)Finds the minimum probability of producing males (i.e., P(male)) such that the population does not die out in 150 years. One way to do this is to systematically increase P(male) from 0 to 0.5 by 0.01 each time until the number of living dolphins is greater than zero at the end of year 149. You need to evolve the dolphin population at least five times and report the average minimum probability forP(male).C)Randomly picks a dolphin (“The Main Character”) around year 70, and builds and plots a genealogy tree that shows all dolphins at the current and parent generations that aredirectly related to the Main Character. Morespecifically:The Main Character: in the middle level.Parents of the Main Character: one level higher.Full Siblings of the Main Character: arrayed on the same level as the Main Character.Half Siblings of the Main Character: arrayed one level below. Like this:You do not need to print the words “Parents”, “Full Siblings”, and “Half Siblings” on your genealogy tree plot — I have included them on this example to help you understand how it should be structured. Save it as genealogy.pdf.For the original population of four dolphins, you can name their parents however you would like, as long as that does not prevent the four dolphins from procreating.代写CS Finance|建模|代码|系统|报告|考试编程类:C++,JAVA ,数据库,WEB,Linux,Nodejs,JSP,Html,Prolog,Python,Haskell,hadoop算法,系统 机器学习金融类:统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导E-mail:[email protected]微信:BadGeniuscs 工作时间:无休息工作日-早上8点到凌晨3点如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。