Beispiel #1
0
 def test_add_truck(self):
     order_probability = 300
     var_food_zone = FoodZone(order_probability)
     price = 3000
     making_time = 60
     var_truck = FoodTruck(price, making_time)
     var_food_zone.add_truck(var_truck)
     self.assertIn(var_truck, var_food_zone.food_trucks)
Beispiel #2
0
 def test_add_truck(self):
     order_probability = 300
     var_food_zone = FoodZone(order_probability)
     price = 3000
     making_time = 60
     var_truck = FoodTruck(price, making_time)
     var_food_zone.add_truck(var_truck)
     self.assertIn(var_truck, var_food_zone.food_trucks) # var_truck이 food_truck에 있나
Beispiel #3
0
def main():
    order_probability = 300
    open_seconds = 60*60*6*20*12
    food_list = [(2000, 60)]
    food_zone1 = FoodZone(order_probability)

    for price, making_time in food_list:
        food_zone1.add_truck(FoodTruck(price, making_time))

    start_simulation(food_zone1, open_seconds)
    print('----# Food zone 결과(영업 시간: {0:.1f}, 손님 확률: 대략 {1}초당 1명) #----'.format(
            open_seconds/(60*60), order_probability))
    print_food_zone_result(food_zone1, open_seconds)
Beispiel #4
0
 def test___init__(self):
     order_probability = 300
     var_food_zone = FoodZone(order_probability)
     self.assertEqual(set(), var_food_zone.food_trucks)
     self.assertEqual(list(), var_food_zone.order_queue)
     self.assertEqual(list(), var_food_zone.waiting_times)
     self.assertEqual(list(), var_food_zone.income)
     self.assertEqual(order_probability, var_food_zone.order_probability)
Beispiel #5
0
 def test_is_new_order(self):
     order_probability = 300
     var_food_zone = FoodZone(order_probability)
     self.assertEqual(True, var_food_zone.is_new_order(order_probability))
     self.assertEqual(False, var_food_zone.is_new_order(order_probability - 1))
Beispiel #6
0
 def test_is_new_order(self):
     order_probability = 300
     var_food_zone = FoodZone(order_probability)
     self.assertEqual(True, var_food_zone.is_new_order(order_probability))
     self.assertEqual(False, var_food_zone.is_new_order(order_probability - 1))