#Weinschenk
#12-14

from __future__ import division
import numpy as np
import pandas as pd
from pylab import *
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})
import random

incident = pd.read_csv('../Data/arlington_incidents.csv', header=0)
total_incidents = len(incident['incident_class_code'])
total_fires = 0
for i in incident['incident_class_code']:
	if i == 1:
	   total_fires = total_fires + 1 

for num in range(1,1000):
	rand = random.randrange(1,len(incident['incident_class_code']),1)
	if incident['incident_class_code'][rand] == 1:
	 	fire = True
	 	print rand,fire
	else:
	 	fire = False

@@ -424,16 +424,177 @@
 es + 1 %0A
+years_of_data = 6%0A%0A#random pull off historical data for ignition%0Afire_call_year = int(total_incidents/years_of_data)%0Aignition = zeros(fire_call_year, dtype=bool)
 %0Afor num
@@ -607,14 +607,24 @@
 nge(
-1,1000
+0,fire_call_year
 ):%0A%09
@@ -744,58 +744,1124 @@
 %0A%09 %09
-fire = True%0A%09 %09print rand,fire%0A%09else:%0A%09 %09fire = False
+ignition%5Bnum%5D = True%0Aprint sum(ignition), 'total fires' #prints number of fires per year%0A%0A#determine location of fire and structure type%0A%0A%0A%0A%0A#firegrowth model%0Afire_size = zeros(sum(ignition))%0Aroom_of_origin = 0%0Afloor_of_origin = 0%0Astructure_loss = 0%0Afor num in range(0,sum(ignition)): %0A%09alpha = np.random.uniform(0.0029,0.047)%0A%09time_to_alarm = np.random.uniform(30,60)%0A%09time_to_dispatch = np.random.uniform(40,80)%0A%09time_to_turnout = np.random.uniform(60,100)%0A%09time_to_arrival = np.random.uniform(300,420)%0A%09time_to_suppress = np.random.uniform(60,180)%0A%09running_time = time_to_alarm+time_to_dispatch+time_to_turnout+time_to_arrival+time_to_suppress%0A%09fire_size%5Bnum%5D = alpha*(running_time)**2%0A%0A%09#assesing damage typical resident structure%0A%09if fire_size%5Bnum%5D %3C 2000:%0A%09%09room_of_origin = room_of_origin + 1%0A%09elif fire_size%5Bnum%5D %3E 2000 and fire_size%5Bnum%5D %3C 10000:%0A%09%09floor_of_origin =floor_of_origin + 1%0A%09else:%0A%09%09structure_loss =structure_loss + 1%0A%0Aprint room_of_origin, 'fire(s) room of origin %7C', floor_of_origin, ' fire(s) floor of origin %7C', structure_loss, 'fire(s) with total structure loss'%0A%0A#firefighter response model%0A%0A
 %0A

update fire script