public Warehouse() { _numRows = 0; _numCols = 0; Map = null; _DicItems = new Dictionary <string, Product>(); _DicMaxStorage = new Dictionary <string, MaxStorage>(); _generalRackList = new List <Rack>(); _hangerRackList = new List <Rack>(); _generalEmptyRacksList = new List <Rack>(); _hangerEmptyRackList = new List <Rack>(); _Pickers = new Dictionary <int, Robot>(); _Hangers = new Dictionary <int, Robot>(); _Transporters = new Dictionary <int, Robot>(); _TransporterForPick = new Dictionary <int, Robot>(); _TransporterForSlot = new Dictionary <int, Robot>(); _AllMovingRobots = new Dictionary <int, Robot>(); _Receiver = null; _Shippers = new Dictionary <int, Robot>(); _PickOrders = new List <Order>(); _SlotOrders = new List <Order>(); rnd = new Random(); #if (DOCKER) LoadItemsFile("app/data/items.csv"); LoadItemCategoriesFile("app/data/item_categories.csv"); LoadMap("app/data/map.csv"); #else LoadItemsFile("data\\items.csv"); LoadItemCategoriesFile("data\\item_categories.csv"); LoadMap("data\\map.csv"); #endif }
private void CreateObject(int row, int column, string wall) { switch (Map[row, column]) { case 10: //General-purpose rack (upward/downward directions) for (int height = 1; height <= 5; height++) { _generalEmptyRacksList.Add(new GeneralPurposeRack(column, row, height, Direction.Up)); _generalEmptyRacksList.Add(new GeneralPurposeRack(column, row, height, Direction.Down)); } Map[row, column] = 1; break; case 11: //General-purpose rack (leftward/rightward directions) for (int height = 1; height <= 5; height++) { _generalEmptyRacksList.Add(new GeneralPurposeRack(column, row, height, Direction.Left)); if (wall.Equals("1") == false) //walk around for racks at (146, 3) { _generalEmptyRacksList.Add(new GeneralPurposeRack(column, row, height, Direction.Right)); } } Map[row, column] = 1; break; case 12: //Hanger rack (leftward/rightward directions) _hangerEmptyRackList.Add(new HangerRack(column, row)); Map[row, column] = 1; break; case 20: //Receiving point _Receiver = new ReceivingRobot(column, row, 5); // Trick: set id = {5} to avoid 0 Map[row, column] = 1; break; case 21: // Shipping point (corresponding to Shipper ID 1 to 4) case 22: case 23: case 24: // Trick: set id = {6 7 8 9} to avoid 1 _Shippers.Add(Map[row, column] - 20, new ShippingRobot(column, row, (Byte)(Map[row, column] - 15))); Map[row, column] = 1; break; default: break; } }