 
   start: ->
     @initialNumCranes = Number($("#num_cranes").val())
-    @percentageEggsToTake = Number($("#percentage_eggs_to_take").val())
-    @captiveEggSurvival = Number($('#captive_egg_survival').val())
-    @wildEggSurvival = Number($('#wild_egg_survival').val())
-    @overallMortalityRate = Number($('#overall_mortality_rate').val())
     @values.length = 0
     @runNumber = 0
     @hasStarted = true

class RickshawStripChart
  tickLength: 10
  values: null
  year: 2015
  initialNumCranes: null
  carryingCapacity: 1000
  numCranes: null
  percentageEggsToTake: null
  captiveEggSurvival: null
  wildEggSurvival: null
  overallMortalityRate: null
  clutchSize: 2
  numYears: 100
  runNumber: 0
  chart: null
  hoverDetail: null
  offset_param: null
  isRunning: false
  hasStarted: false
  notDone: true

  constructor: ->
    @values = []

  drawChart: ->
    @chart.render()

  extendData: ->
    years = [@year...(@year+@numYears)]
    population = new Population(@initialNumCranes)
    simulator = new Simulator(population)
    entries = []
    for year in years
      popSize = simulator.getPopulation().birds().length
      entry = { x: year, y: popSize }
      entries.push(entry)
      if popSize <= 0
        break
      simulator.advanceOneYear()
    @values.push({
      name: "Run ##{@runNumber}"
      color: "rgba(0, 0, 0, 0.1)"
      data: entries
      })

  tick: =>
    @extendData()
    @drawChart()
    @runNumber = @runNumber + 1
    @notDone = @runNumber < @numRuns
    if not @notDone
      @isRunning = false
      @hasStarted = false
