Select Page

WRK 100 Strayer University Lithonia Campus Skill Development Plan Paper

Question Description

# Final project for CS8 – Summer 2020, Professor Jeff Moehlis (Prof J-Mo)

# Final project for CS8 - Summer 2020,Professor Jeff Moehlis (Prof J-Mo) # We've included some structure andcommands, and you'll need to fill # in the rest import random defsetParameter(paramStr,defaultValue):# Do not change this function    '''This function takes as input a string paramStr and a float or    int defaultValue.  If paramStr isthe empty string, the function    returns the value of defaultValue. If paramStr is not the empty   string, the function returns the float or integer associated with    the string, according to the type of defaultValue.    param paramStr: a string   param defaultValue: can be either a float or an int   '''    if paramStr == "":       return defaultValue   else:       if type(defaultValue) == int:            return int(paramStr)       else:                       return float(paramStr)  defrunTrial(beta,kappa,S0,Z0,survivors):# You will need to fill in the codefor this function    ''' This function simulates a single trial, where a trial is a   simulation of the zombie model which starts with S0 susceptibles   and Z_0 zombies, and proceeds until either the humans win (Z=0) or   the zombies win (S=0).  The inputparameters S0, Z0, beta, and kappa    are model parameters.  The inputparameter survivors is a list    containing the number of human survivors for all trials so far for    which there is a positive number. If the zombies win, the function    returns the string "zombies". If the humans win, the function returns    the string "humans"    param beta: a float giving the rate of zombie infection   param kappa: a float giving the rate at which zombies are killed   param S0: an integer giving the initial number of humans   param Z0: an integer giving the initial number of zombies   param survivors: a list of integers containing the number of human    survivors for all trials so far for which there is a positive    number; note that this is mutable   '''    # Dictionary which contains defaultvalues for the model parameters# Do not change this dictionarydefault = {   "beta":0.01,   "kappa":0.008,   "S0":190,   "Z0":10,   "numtrials":100}  # Main Program ans = input("Would you like touse the default values for model parameters? (y or n): ") if ans == 'y':   # use default values for model parameters;# the values should be accessed fromthe dictionary called default   beta = ...   kappa =    S0 =     Z0 =    numtrials = else:   beta_str = input("Enter value for beta (Press return for beta ={}): "                    .format(default["beta"]))   beta = setParameter(...)   # thisneeds to be filled in # do similar commands to set thevalues for kappa, S0, Z0, and numtrials   # Here you'll do numtrials simulationsof the zombie apocalypse, keeping# track of how many times the humanswin.  Think of this as a Monte Carlo# simulation, as discussed in lecture.  # calculate and print the percentchance that the humans win, in the# format given in the problemstatement  # If appropriate according to theproblem statement, print# "Yikes!"# "Sorry, doesn't look good forthe humans!"# "It's a toss-up!"# or "Looks good for thehumans!"   # If there was at least one trial forwhich at least one human survived, print# the average number of suvivors inthe format given in the problem statment

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now