static void Scenario1(Panel myPanel, CageManager myCageManager) { myCageManager.colList[1].cages[0].levelActual = 10; myCageManager.colList[1].cages[1].levelActual = 5; myCageManager.colList[1].cages[2].levelActual = 19; myCageManager.colList[1].cages[3].levelActual = 15; myCageManager.colList[1].cages[4].levelActual = 8; Console.WriteLine("---------Scenario 1------------"); Console.WriteLine(" Pickup: 7, direction: down"); Console.WriteLine(" Pickup: 13, direction: up"); Console.WriteLine(" Pickup: 5, direction: down"); Console.WriteLine(" Pickup: 2, direction: down"); Console.WriteLine(" Pickup: 5, direction: down"); Console.WriteLine(" some one is floor 1 and request destination :17 "); Console.WriteLine("---------Scenario 1------------"); //Order(string status, int pickup, int destination, string direction) OrderQueue.Add(new Order("Destination", 0, 7, "down")); OrderQueue[0].assignment = "Assigned"; myCageManager.colList[1].cages[0].destReq.Add(OrderQueue[0]); OrderQueue.Add(new Order("Destination", 0, 13, "up")); OrderQueue[1].assignment = "Assigned"; myCageManager.colList[1].cages[1].destReq.Add(OrderQueue[1]); OrderQueue.Add(new Order("Destination", 0, 5, "down")); OrderQueue[2].assignment = "Assigned"; myCageManager.colList[1].cages[2].destReq.Add(OrderQueue[2]); OrderQueue.Add(new Order("Destination", 0, 2, "down")); OrderQueue[3].assignment = "Assigned"; myCageManager.colList[1].cages[3].destReq.Add(OrderQueue[3]); Console.WriteLine(" destination: 1, direction: down"); OrderQueue.Add(new Order("Destination", 0, 5, "down")); OrderQueue[4].assignment = "Assigned"; myCageManager.colList[1].cages[4].destReq.Add(OrderQueue[4]); LoopTest(myPanel, myCageManager); OrderQueue.Add(new Order("Pickup", 1, 17, "up")); while (OrderQueue.Count > 0) { LoopTest(myPanel, myCageManager); } myCageManager.takeCageStatus(); }
static void Scenario3(Panel myPanel, CageManager myCageManager) { myCageManager.colList[3].cages[0].levelActual = 58; myCageManager.colList[3].cages[1].levelActual = 50; myCageManager.colList[3].cages[2].levelActual = 46; myCageManager.colList[3].cages[3].levelActual = 1; myCageManager.colList[3].cages[4].levelActual = 60; Console.WriteLine("---------Scenario 3------------"); Console.WriteLine(" Pickup: 1, direction: down"); Console.WriteLine(" Pickup: 63, direction: up"); Console.WriteLine(" Pickup: 54, direction: up"); Console.WriteLine(" Pickup: 50, direction: down"); Console.WriteLine(" Pickup: 1, direction: up"); Console.WriteLine(" some one is floor 57 and request destination :1 "); Console.WriteLine("---------Scenario 3-----------"); //public Order(string status, int pickup, int destination, string direction) OrderQueue.Add(new Order("Destination", 0, 1, "down")); OrderQueue[0].assignment = "Assigned"; myCageManager.colList[3].cages[0].destReq.Add(OrderQueue[0]); OrderQueue.Add(new Order("Destination", 0, 63, "up")); OrderQueue[1].assignment = "Assigned"; myCageManager.colList[3].cages[1].destReq.Add(OrderQueue[1]); OrderQueue.Add(new Order("Destination", 0, 54, "up")); OrderQueue[2].assignment = "Assigned"; myCageManager.colList[3].cages[2].destReq.Add(OrderQueue[2]); OrderQueue.Add(new Order("Destination", 0, 50, "up")); OrderQueue[3].assignment = "Assigned"; myCageManager.colList[3].cages[3].destReq.Add(OrderQueue[3]); OrderQueue.Add(new Order("Destination", 0, 1, "up")); OrderQueue[4].assignment = "Assigned"; myCageManager.colList[3].cages[4].destReq.Add(OrderQueue[4]); LoopTest(myPanel, myCageManager); OrderQueue.Add(new Order("Pickup", 57, 1, "down")); while (OrderQueue.Count > 0) { LoopTest(myPanel, myCageManager); } myCageManager.takeCageStatus(); }
static void Scenario2(Panel myPanel, CageManager myCageManager) { myCageManager.colList[2].cages[0].levelActual = 5; myCageManager.colList[2].cages[1].levelActual = 1; myCageManager.colList[2].cages[2].levelActual = 17; myCageManager.colList[2].cages[3].levelActual = 30; myCageManager.colList[2].cages[4].levelActual = 40; Console.WriteLine("---------Scenario 2------------"); Console.WriteLine(" Pickup: 21, direction: up"); Console.WriteLine(" Pickup: 28, direction: up"); Console.WriteLine(" Pickup: 1, direction: down"); Console.WriteLine(" Pickup: 24, direction: down"); Console.WriteLine(" Pickup: 3, direction: down"); Console.WriteLine(" some one is floor 1 and request destination :33 "); Console.WriteLine("---------Scenario 2-----------"); //public Order(string status, int pickup, int destination, string direction) OrderQueue.Add(new Order("Destination", 0, 21, "up")); OrderQueue[0].assignment = "Assigned"; myCageManager.colList[2].cages[0].destReq.Add(OrderQueue[0]); OrderQueue.Add(new Order("Destination", 0, 28, "up")); OrderQueue[1].assignment = "Assigned"; myCageManager.colList[2].cages[1].destReq.Add(OrderQueue[1]); OrderQueue.Add(new Order("Destination", 0, 1, "down")); OrderQueue[2].assignment = "Assigned"; myCageManager.colList[2].cages[2].destReq.Add(OrderQueue[2]); OrderQueue.Add(new Order("Destination", 0, 24, "down")); OrderQueue[3].assignment = "Assigned"; myCageManager.colList[2].cages[3].destReq.Add(OrderQueue[3]); OrderQueue.Add(new Order("Destination", 0, 3, "down")); OrderQueue[4].assignment = "Assigned"; myCageManager.colList[2].cages[4].destReq.Add(OrderQueue[4]); OrderQueue.Add(new Order("Pickup", 1, 33, "up")); while (OrderQueue.Count > 0) { LoopTest(myPanel, myCageManager); } myCageManager.takeCageStatus(); }
static void Scenario4(Panel myPanel, CageManager myCageManager) { myCageManager.colList[0].cages[0].levelActual = -4; myCageManager.colList[0].cages[1].levelActual = 1; myCageManager.colList[0].cages[2].levelActual = -3; myCageManager.colList[0].cages[3].levelActual = -6; myCageManager.colList[0].cages[4].levelActual = -1; Console.WriteLine("---------Scenario 4------------"); Console.WriteLine(" Pickup: -5, direction: down"); Console.WriteLine(" Pickup: 1, direction: up"); Console.WriteLine(" Pickup: -3, direction: down"); Console.WriteLine("---------Scenario 4-----------"); myCageManager.colList[0].cages[2].status = "Loading"; myCageManager.colList[0].cages[3].status = "Loading"; myCageManager.colList[0].cages[4].status = "Loading"; myCageManager.colList[0].cages[2].direction = "down"; myCageManager.colList[0].cages[3].direction = "up"; myCageManager.colList[0].cages[4].direction = "down"; //public Order(string status, int pickup, int destination, string direction) OrderQueue.Add(new Order("Destination", 0, -5, "down")); OrderQueue[0].assignment = "Assigned"; myCageManager.colList[0].cages[2].destReq.Add(OrderQueue[0]); OrderQueue.Add(new Order("Destination", 0, 1, "up")); OrderQueue[1].assignment = "Assigned"; myCageManager.colList[0].cages[3].destReq.Add(OrderQueue[1]); OrderQueue.Add(new Order("Destination", 0, -3, "down")); OrderQueue[2].assignment = "Assigned"; myCageManager.colList[0].cages[4].destReq.Add(OrderQueue[2]); LoopTest(myPanel, myCageManager); while (OrderQueue.Count > 0) { LoopTest(myPanel, myCageManager); } myCageManager.takeCageStatus(); }