예제 #1
0
        private static Tennis_Complex GetTennis_Complex_CompletelyRandom(List<Outlook> outlookOptions)
        {
            var tennis = new Tennis_Complex()
            {
                Play = Randm.Helper.PickBool(0.5),
                WeatherConditions = new WeatherConditions()
                {
                    Outlook = Randm.Helper.PickOne(outlookOptions),
                    //Temperature = Randm.Helper.NextDouble(minInclusive:0.0d, maxExclusive: 110.0 70.PickBool(0.5) ? Temperature.Low : Temperature.High,
                    Temperature = Randm.Helper.NextDouble(minInclusive: 0.0d, maxExclusive: 110.0),
                    Windy = Randm.Helper.PickBool(0.5),
                }
            };

            return tennis;
        }
예제 #2
0
        private static Tennis_Complex GetTennis_Complex_UsuallyPlayFairConditions(List<Outlook> outlookOptions)
        {
            var tennis = new Tennis_Complex()
            {
                WeatherConditions = new WeatherConditions()
                {
                    Outlook = Randm.Helper.PickOne(outlookOptions),
                    Temperature = Randm.Helper.NextDouble(minInclusive: 0.0d, maxExclusive: 110.0),
                    //Temperature = Randm.Helper.PickBool(0.7) ? Temperature.Low : Temperature.High,
                    Windy = Randm.Helper.PickBool(0.7),
                }
            };

            if (tennis.WeatherConditions.Temperature < 32.0d)
                tennis.Play = Randm.Helper.PickBool(0.1);
            else if (tennis.WeatherConditions.Windy && tennis.WeatherConditions.Outlook == Outlook.Rainy)
                tennis.Play = Randm.Helper.PickBool(0.1);
            else if (tennis.WeatherConditions.Outlook == Outlook.Overcast)
                tennis.Play = Randm.Helper.PickBool(0.8);
            else
                tennis.Play = Randm.Helper.PickBool(0.9);

            return tennis;
        }