projects:project2-sk

filename project2-sk.py
import numpy
import pylab
 
#Plotting Function:
#yList = rabbit list 
#zList = fox list
#n = Number of runs
def drawCurve(yList,zList,n):
    x = pylab.arange(n)
    pylab.title("Foxes and Rabbits")
    pylab.ylabel("Number of predator (Foxes)")
    pylab.xlabel("\nNumber of prey  (Rabbits)")
    pylab.plot(x, yList, 'b') 
    pylab.plot(x, zList, 'r')
    pylab.legend(('Rabbits','Foxes'),loc='upper left')
    pylab.show()
 
#TODO 1: 
 
#TODO 2: 
 
#TODO 3
#Simulation:
#*******************************************************        
    #Get Number of Runs from user
 
    #Create two lists, one for Rabbits and one for Foxes
 
    #Repeat process
    #***************
        #Add current value of rabbits to rabbit list
 
        #Add current value of foxes to fox list
 
        #Call TODO1 and TODO2 functions
 
        #Update variables and compare
    #***************
 
    #Print MIN of populations
 
    #call drawCurve function 
 
#*******************************************************  
 
#TODO 4      
def main():
    print("Project 3")
 
    #Create a MENU
  • projects/project2-sk.txt
  • Last modified: 2012/09/19 15:53
  • by lmartino