def testMultiNodeBusTranslator(self): ''' Example using a MultiNodeBus with Translator object. ''' FILENAME = 'multi_bus_translator.json' with open_bus(FILENAME) as bus: while not bus.finished: __out = bus.transaction(inputs=translator_multinode_input()) print translator_out_to_string(__out) print 'bus finished'
def testFileBusTranslator(self): ''' Example using a FileBus with an AggregatorBusTranslator. ''' FILENAME = 'file_bus_translator.json' with open_bus(FILENAME) as bus: while not bus.finished: __out = bus.transaction(inputs=None) print translator_out_to_string(__out) print 'bus finished'
def testFileBus(self): ''' Example using a FileBus. ''' FILENAME = 'file_bus.json' with open_bus(FILENAME) as bus: while not bus.finished: __out = bus.transaction(inputs=None) print out_to_string(__out) print 'bus finished'
def remote(self): ''' Example using a GridlabBus with a remote GLD. Will change the base_power for the load at each timestep. Will then query the network_node power. ''' FILENAME = 'remote_params.json' with open_bus(FILENAME) as bus: while not bus.finished: __out = bus.transaction(inputs=message_gld_input()) print out_to_string(__out) print 'bus finished'
def testGridlabBus(self): ''' Example using a GridlabBus. Will change the base_power for the load house0_agg_R4-25-00-1_tm_1_R4-25-00-1_tn_141 at each timestep. Will then query the network_node power. ''' FILENAME = 'gridlabd_bus.json' with open_bus(FILENAME) as bus: while not bus.finished: __out = bus.transaction(inputs=message_gld_input()) print out_to_string(__out) print 'bus finished'
def testContextManager(self): self._load_time() os.chdir(os.path.join(dir_name,fld_name)) print '-------------------------' print 'RUNNING BUS: ' + os.path.join(dir_name, bus_name) print '-------------------------' print with open_bus(bus_name) as bus: while(not (bus.finished or self._check_time())): self._time.advance_time() __out = bus.transaction(self._aggregator_dict()) print str(self._time) + ':' + str(__out[AggregatorBusTranslator.OUT_P_RE_KEY]) + '+ ' + str(__out[AggregatorBusTranslator.OUT_P_IM_KEY]) + 'j' assert True
def testContextManager(self): self._load_time() os.chdir(os.path.join(dir_name, fld_name)) print '-------------------------' print 'RUNNING BUS: ' + os.path.join(dir_name, bus_name) print '-------------------------' print with open_bus(bus_name) as bus: while (not (bus.finished or self._check_time())): self._time.advance_time() __out = bus.transaction(self._aggregator_dict()) print str(self._time) + ':' + str( __out[AggregatorBusTranslator.OUT_P_RE_KEY]) + '+ ' + str( __out[AggregatorBusTranslator.OUT_P_IM_KEY]) + 'j' assert True
ermax_list12 = [] ermax_list11 = [] ermax_list10 = [] ermax_list9 = [] ermax_list8 = [] ermax_list7 = [] voltage_prev_12 = 240 voltage_prev_11 = 240 voltage_prev_10 = 240 voltage_prev_9 = 240 voltage_prev_8 = 240 voltage_prev_7 = 240 with open_bus(BUS_FILE_MAIN) as bus_MAIN: with open_bus(BUS_FILE_ITER) as bus_ITER: while not bus_MAIN.finished: Display = Display + 1 print Display PMPPT = (0 - DATA_FRAME[0][current_time]) LOAD_current_time = [] for i in range(1, 13): LOAD_current_time.append((DATA_FRAME[i][current_time])) er12 = [] er11 = []