Warehouse Logistics Quick Reference

Understanding The Gamestate

Your calculateMove() function will be passed the current state of the game, the 'gameState'. The gameState is a python dictionary containing the following keys:

  • Warehouse - Is a list of lists that give the layout of a the warehouse. Each position in the warehouse can either contain an empty space, a fixture, a dispatch desk or a picker start location. For further information see 'Understanding the Warehouse Layout' below.
  • Pickers - Is a list of the pickers you have available to carry out the work in the warehouse. For further information see 'Understanding How Pickers Operate' below.
  • DispatchDesks - Is a list of dispatch desks that you have available to send items from the warehouse. See 'Dispatch Desks' section below for more information.
  • Fixtures - Is a list of fixtures around the warehouse where inventory is stored. See 'What are Fixtures' section below for more information.
  • Inventory - Is a list of inventory and what fixtures it is stored in around the warehouse.
  • Items - Is a list of items you are required to dispatch to complete the game.
  • EndTime - The epoch time, in milliseconds at which this game will end.
  • MyBest - Your current best solution. This includes 'Length' which is how long your solution takes in game time units and 'Time' the epoch time you submitted this solution.
  • OppBest - Your opponents best solution. This includes 'Length' which is how long your opponents solution takes in game time units and 'Time' the epoch time they submitted this solution.
  • GameStatus - A string that will have value "RUNNING" if the game is in progress or a reason the game has ended otherwise.
  • IsMover - Always set to 'True' whilst the game is in play.
  • GameId - An integer representing the unique game id for the current game.
  • OpponentId - A string containing the name of your opponent.

Understanding the Warehouse Layout

The warehouse is given to you in a list of lists. The gamestyle determines how big the warehouse is and it is randomly generated for each game. The warehouse is laid out in grid form with (0,0) being the top left hand corner. An empty space in the warehouse is represented as five blank spaces (' ') in the list. If the element in the list starts with a 'F' this means a fixture is in that location. If the element in the list starts with a 'P' this means a picker starts in that location. If the element in the list starts with a 'D' this means there is a dispatch desk in that location. For example if the Warehouse gameState entry contains:

'Warehouse': [
['     ', '     ', '     ', '     ', '     '], 
['     ', '     ', 'F0000', '     ', '     '], 
['     ', '     ', 'D000', '     ', '     '], 
['P000', '     ', '     ', '     ', '     '], 
['     ', '     ', '     ', '     ', '     ']]

This would result in a simple warehouse layout as shown below:

whl_example2.png

The fixtures are shown in blue, pickers in green, dispatch desks in orange and empty floor space in grey.

Understanding How Pickers Operate

A picker moves around the warehouse collecting inventory from fixtures and taking them to dispatch desks. Every picker has attributes associated with their abilities:

  • Id - The Id of the picker. A string that starts with 'P' that will also be indicated in the warehouse layout.
  • Location - The starting location in the warehouse where (0,0) is the top left hand corner.
  • Speed - Is the speed the picker moves around the warehouse. The number represents the number of squares they can move in one unit of time. However when calculating how long a picker takes to get from one point in the warehouse to another the time units always round up eg if you are moving 11 squares and the picker speed is 10 then it will take 2 units of time to move this distance.
  • MaximumLoad - Is the maximum load that picker can carry at any time. When working out the load it is quantity * item size. If a pickers maximum load is 0 then they can carry any amount of items.
  • ItemTypes - Is the list of item types this picker can carry. For example certain pickers may only be able to carry 'Fragile' items.
  • StartTime - Is the time this picker comes on shift. If 0 they are available from the beginning. The time is just a single whole number that represents game time units. For example if a picker had a StartTime of 200 then this picker will be available 200 units into the game and cannot do any work before that time, so if you use them the minimum time you would have for this solution would be 200 plus the time it takes them to carry out any work.
  • EndTime - Is the time this picker comes off shift. If they are still moving inventory at this time into the game you will get an invalid move returned. If EndTime is set to 0 they are available throughout the game.

A picker when moving around the warehouse can occupy the same square as any number of other pickers i.e. they do not need to avoid one another when calculating the length of time to move from one fixture to another. A picker will always take the shortest route between two points in the warehouse, therefore you do not need to instruct the picker how to get from one point to another just that they need to visit a series of points in the warehouse.

Dispatch Desks

A dispatch desk is a place where a picker takes an item to send it from the warehouse. Every dispatch desk has a number of attributes associated with it:

  • Id - The Id of the dispatch desk. A string that starts with 'D' that will also be indicated in the warehouse layout.
  • Location - The location in the warehouse of the dispatch desk where (0,0) is the top left hand corner. The position of the each desk is static and does not move during the game.
  • Throughput - Is the list of speeds each inventory type is processed at the desk. For example if you have two inventory item types of 'Fragile' and 'Food' there will be two entries in the list associated with each type. The throughput speed is the number of size units a dispatch desk can process in one unit of time. For example if a dispatch desk has a throughput of 10 and it has to dispatch 6 units of inventory that is 7 in size it would take $(7/10)*6 = 4.2$units of time to process, this would then get rounded up to 5 units of time.
  • MaximumSize - Is the maximum size of inventory item that this dispatch desk can handle. If a picker tries to drop off an item that is too big then you will receive an invalid move. If the maximum size is set to 0 then this dispatch desk can take any sized inventory.
  • ItemTypes - Is the list of inventory types that this dispatch desk can process.
  • StartTime - Is the start time this dispatch desk can start taking inventory to process. If 0 then this dispatch desk is available from the beginning. The start time is a just a single whole number that represents in game time units.
  • EndTime - Is the end time this dispatch desk can take inventory to process. If 0 then this dispatch desk is available throughout the game. If inventory is dropped off at the desk past this time you will receive an invalid move.

What are Fixtures

A fixture is a area in the warehouse designated to store stock. In most real life warehouses this would be a set of racking or shelving but it also could be just an area on the floor a pallet is stored. Each fixture can hold any type of inventory. Every fixture has a number of attributes:

  • Id - The Id of the fixture. A string that starts with 'F' that will also be indicated in the warehouse layout.
  • Location - The location in the warehouse of the fixture where (0,0) is the top left hand corner. The position of the each fixture is static and does not move during the game.
  • PickDifficulty - How difficult this fixture is to take stock from. This is the length of time it takes to remove one unit of inventory from the fixture. If you have to pick two or more units then the amount of time required will vary based upon a formula where the second item takes half the time, the third item takes a third of the time, the forth item a quarter of the time etc. This calculation stops at ten units and every item after ten will take one tenth of the time. For example if you have a pick difficulty of 100 and you need to pick 13 items from this fixture the calculation will be as follows '100+50+33.33+25+20+16.66+14.28+12.5+11.11+10+10+10+10 = 322.89'. This would result in a pick time of 323 as all values are rounded up at the end of a calculation.

Inventory

Is a list of inventory stored in fixtures around the warehouse. During the game inventory levels will go down as pickers take the stock from fixtures to the dispatch desks. The same inventory type can exists in multiple places in the warehouse. The inventory lists are constructed as follows:

  • Id - The id of the inventory. Remember you could have multiple entries with the same Id as it can be stored in different locations around the warehouse.
  • FixtureId - The fixture Id where this stock is stored.
  • Type - The inventory type e.g. 'Food'. This will determine what pickers and dispatch desks this inventory can be handled by.
  • Size - The size of the a single piece on inventory. This will determine how quickly a dispatch desk can process the inventory and also how much a picker can carry.
  • Quantity - How many units of an item is stored in that fixture.

Items to Dispatch

The items list contains the inventory that must be picked from fixtures and then taken to dispatch desks for processing. The list can be processed in any order and you can part ship quantities of the same inventory through different dispatch desks if required e.g. the item list contains {'Id': 'I004', 'Quantity': 5} you could dispatch 3 units though one dispatch desk and 2 units though another.

How to Submit a Solution

A solution is all the moves required to pick and process every item in the items list. The return value from calculateMove should be a list of lists, each entry in the top level list are the instructions to a picker where to go in the warehouse. If the instructions are in position 0 in the list these are carried out by picker Id P000, if position 1 then picker ID P001 etc. If you do not want a picker to carry out any operation then the list should be empty i.e. [].
For example if you submit the following solution:

[[{'Location': 'F0000', 'Item': 'I030', 'Quantity': 4}, {'Location': 'D000', 'Item': 'I030', 'Quantity': 4}],[],[{'Location': 'F0000', 'Item': 'I030', 'Quantity': 2},{'Location': 'F0001', 'Item': 'I030', 'Quantity': 3}, {'Location': 'D001', 'Item': 'I030', 'Quantity': 5}]]

This would result in:

  • Picker Id P000 going to fixture F0000 and taking 4 units of item I030 to dispatch desk D000.
  • Picker Id P001 doing nothing
  • Picker Id P002 going to fixture F0000 and taking 2 units of item I030, then to fixture F0001 and taking 3 units of item I030 and then going to dispatch desk D001 to dispatch all 5 units of I030.

This would solve the problem if the items list contains:

[{'Id': 'I030', 'Quantity': 9}]

Helper Functions

  • FindFixtures - Given an item id, the inventory and required quantity it will return a list of the fixtures containing that item in at least that quantity.
  • GetSize - Given an item id and the inventory, returns the size of the item.
  • GetType - Given an item id and the inventory, returns the type of the item.
  • CanPick - Given an item id, the inventory, and a picker, returns whether the picker can pick an item of that size and type (if they are carrying nothing else).

Jargon:

  • Epoch time - The number of seconds (or in our case milliseconds) that have elapsed since January 1 1970 00:00 UTC.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License