// 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); }
// value count > 0 private int GetValueCount(IWeightsDistribution <double> d) { return(d == null?Rand.Next(1, 10) : d.Weights.Count()); }