本文整理匯總了Python中input_reader.InputReader.read方法的典型用法代碼示例。如果您正苦於以下問題:Python InputReader.read方法的具體用法?Python InputReader.read怎麽用?Python InputReader.read使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類input_reader.InputReader
的用法示例。
在下文中一共展示了InputReader.read方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from input_reader import InputReader [as 別名]
# 或者: from input_reader.InputReader import read [as 別名]
def __init__(self):
input_reader = InputReader()
self.state = input_reader.read(0)
self.output_writer = OutputWriter('naive')
self.num_rows = self.state['numRows']
self.num_cols = self.state['numCols']
self.num_drones = self.state['numDrones']
self.num_turns = self.state['numTurns']
self.max_payload = self.state['maxPayload']
self.num_product_types = self.state['numProductTypes']
self.product_weights = self.state['productWeights']
self.num_warehouses = self.state['numWarehouses']
# warehouse: liste auf dicts: x, y, items -> itemstock
self.warehouse_data = self.state['warehousesData']
# order data: liste auf dicts: x, y, numorders, items
self.order_data = self.state['orderData']
# get list of items
self.item_lists = numpy.zeros((len(self.order_data), len(self.product_weights)), dtype=int)
self.turns_used = numpy.zeros(self.num_drones)
self.drone_location = numpy.zeros((self.num_drones, 2))
for order_idx in numpy.arange(len(self.order_data)):
for item in self.order_data[order_idx]['items']:
self.item_lists[order_idx][item] += 1
for n in numpy.arange(self.num_drones):
self.drone_location[n] = [0, 0]