コード例 #1
0
        // all weights > 0
        private ICollection <double> GetWeights(IWeightsDistribution <double> d)
        {
            Func <double> r = () => Rand.NextDouble(0.1, 10);

            return(d == null ? new List <double> {
                r(), r(), r(), r(), r()
            } : d.Weights);
        }
コード例 #2
0
 // value count > 0
 private int GetValueCount(IWeightsDistribution <double> d)
 {
     return(d == null?Rand.Next(1, 10) : d.Weights.Count());
 }