本文整理汇总了Python中Warehouse.Warehouse.addInventory方法的典型用法代码示例。如果您正苦于以下问题:Python Warehouse.addInventory方法的具体用法?Python Warehouse.addInventory怎么用?Python Warehouse.addInventory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Warehouse.Warehouse
的用法示例。
在下文中一共展示了Warehouse.addInventory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: int
# 需要导入模块: from Warehouse import Warehouse [as 别名]
# 或者: from Warehouse.Warehouse import addInventory [as 别名]
types_no = int(types_no)
ps = f.readline().strip().split(' ')
product_weights = []
for i in ps:
product_weights.append(int(i))
# create a couple of warehouses and add inventory
warehouses = []
wn = f.readline().strip()
wn = int(wn)
for i in range(wn):
co_ords = f.readline().strip().split(' ')
warehouse = Warehouse((int(co_ords[0]), int(co_ords[1])))
inv = f.readline().strip().split(' ')
for i in range(types_no):
warehouse.addInventory(i, inv[i])
warehouses.append(warehouse)
# customer orders.
orders_no = f.readline().strip()
orders_no = int(orders_no)
orders = []
for _ in range(orders_no):
pos = f.readline().strip().split(' ')
order = {}
order['position'] = (int(pos[0]), int(pos[1]))
order['amount'] = int(f.readline().strip())
p_types = f.readline().strip().split(' ')
order['p_types'] = {}
for j in p_types:
if (int(j) in order['p_types']):