Exemple #1
0
        public void Visit <TSource, TCollection, TResult>(SelectMany <TSource, TCollection, TResult> selectmany)
        {
            selectmany.source.Accept(this);
            var a = (Weighted <TSource>) this.sample;

            var b = selectmany.CollectionSelector(a.Value);

            b.Accept(this);
            var c = (Weighted <TCollection>) this.sample;

            var result = selectmany.ResultSelector(a.Value, c.Value);

            result.Probability *= (a.Probability * c.Probability);
            this.sample         = result;
        }
Exemple #2
0
 public void Visit <TSource, TCollection, TResult>(SelectMany <TSource, TCollection, TResult> selectmany)
 {
     throw new NotImplementedException();
 }