Пример #1
0
 public Customer(Demand demand)
 {
     CustomerBuyProbability(demand);
 }
Пример #2
0
        public void GetTotalCustomers(Random rnd, Recipe recipe)//customers that come out based on weather conditions
        {
            Demand demand = new Demand(recipe, weather);

            if (weather.temperature == "Hot" && weather.condition == "and sunny")
            {
                int customerNumber = rnd.Next(35, 40);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Hot" && weather.condition == "and cloudy")
            {
                int customerNumber = rnd.Next(30, 34);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Hot" && weather.condition == "with thunderstorms")
            {
                int customerNumber = rnd.Next(20, 29);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Warm" && weather.condition == "and sunny")
            {
                int customerNumber = rnd.Next(25, 31);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Warm" && weather.condition == "and cloudy")
            {
                int customerNumber = rnd.Next(20, 24);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Warm" && weather.condition == "with thunderstorms")
            {
                int customerNumber = rnd.Next(15, 19);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Cold" && weather.condition == "and sunny")
            {
                int customerNumber = rnd.Next(5, 11);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Cold" && weather.condition == "and cloudy")
            {
                int customerNumber = rnd.Next(0, 10);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
            else if (weather.temperature == "Cold" && weather.condition == "with thunderstorms")
            {
                int customerNumber = rnd.Next(0, 4);
                for (int i = 0; i < customerNumber; i++)
                {
                    customer.Add(new Customer(demand));
                }
            }
        }