def run(self): sim = Simulator(self.location, self.year_choice, Windturbine(5), terrain_factor = self.terrain_factor ) sim.latitude = self.latitude sim.longitude = self.longitude if self.store_wt_out: P_wt,_ = sim.calc_wind(self.windfeatures) else: P_wt = 0 if self.store_sp_out: P_sp,_ = sim.calc_solar(Az=self.solarfeatures[2::3], Inc=self.solarfeatures[1::3],sp_area=self.solarfeatures[0::3], sp_eff=self.sp_eff) else: P_sp = 0 if self.store_total_out: P_tot,_ = sim.calc_total_power(self.solarfeatures, self.windfeatures, self.sp_eff) else: P_tot = 0 data = {'Pwt':P_wt,'Psp': P_sp,'Ptot': P_tot} self.write_data(data, self.filename) evt = SimDoneEvent(myEVT_SIMDONE, -1, filename=self.filename) wx.PostEvent(self.parent, evt)
best_pick = best_array[0] best_solar = best_pick[:12] best_wind = best_pick[-2:] best_pick_power, _ = sim.calc_total_power(best_solar, best_wind, 16) total_solar_sm = np.sum(best_solar[0::3]) costings = cost_calc.calculate_cost(best_pick_power, total_solar_sm, TURBINETYPE, int(best_wind[0])) stats = cost_calc.get_stats(best_pick_power, total_solar_sm, TURBINETYPE, int(best_wind[0])) sol_power, _ = sim.calc_solar(Az=best_solar[2::3], Inc=best_solar[1::3], sp_area=best_solar[0::3]) win_power, _ = sim.calc_wind(best_wind) win_power_total = np.sum(win_power) sol_power_total = np.sum(sol_power) inputs = { 'Name': loc_data.name, 'Year': years[j], 'Lat': loc_data.latitude, 'Lon': loc_data.longitude, 'storage_st_cost': 400, 'zp_st_cost': 160, 'wt_st_cost': 3210000, 'Zp1_angle': best_solar[1], 'Zp1_or': best_solar[2], 'Zp1_area': best_solar[0], 'Zp2_angle': best_solar[4],