Пример #1
0
        /// <summary>
        /// Introduces several records to an <see cref="InputCollection{TRecord}"/> with the same integer weight.
        /// </summary>
        /// <typeparam name="TRecord">The type of the records.</typeparam>
        /// <param name="input">The input.</param>
        /// <param name="records">The records.</param>
        /// <param name="weight">Positive or negative weight for each record</param>
        public static void OnNext <TRecord>(this InputCollection <TRecord> input, IEnumerable <TRecord> records, int weight)
            where TRecord : IEquatable <TRecord>
        {
            if (records == null)
            {
                throw new ArgumentNullException("records");
            }

            input.OnNext(records.Select(x => new Weighted <TRecord>(x, weight)));
        }
Пример #2
0
        private void CallOnNext()
        {
            users.OnNext(rawUsers);
            // users.OnCompleted();
            posts.OnNext(rawPosts);
            //posts.OnCompleted();
            comments.OnNext(rawComments);
            //comments.OnCompleted();
            commentedEdges.OnNext(rawCommentedEdges);
            //commentedEdges.OnCompleted();
            likesEdges.OnNext(rawLikesEdges);
            //likesEdges.OnCompleted();
            postEdges.OnNext(rawPostEdges);
            //postEdges.OnCompleted();
            submitterEdges.OnNext(rawSubmitterEdges);
            //submitterEdges.OnCompleted();
            friendEdges.OnNext(rawFriendEdges);
            //friendEdges.OnCompleted();

            ++actualEpoch;
        }
Пример #3
0
 /// <summary>
 /// Introduces no records to a <see cref="InputCollection{TRecord}"/>.
 /// </summary>
 /// <remarks>
 /// This extension method is typically used when a computation has multiple inputs, to "tick" the
 /// inputs that have not changed in an epoch.
 /// </remarks>
 /// <typeparam name="TRecord">The type of records in the input.</typeparam>
 /// <param name="input">The input.</param>
 public static void OnNext <TRecord>(this InputCollection <TRecord> input)
     where TRecord : IEquatable <TRecord>
 {
     input.OnNext((IEnumerable <Weighted <TRecord> >)null);
 }
Пример #4
0
 /// <summary>
 /// Introduces a record to an <see cref="InputCollection{TRecord}"/> with an integer weight.
 /// </summary>
 /// <typeparam name="TRecord">The type of the record.</typeparam>
 /// <param name="input">The input.</param>
 /// <param name="record">The record.</param>
 /// <param name="weight">Positive or negative weight for the record.</param>
 public static void OnNext <TRecord>(this InputCollection <TRecord> input, TRecord record, int weight)
     where TRecord : IEquatable <TRecord>
 {
     input.OnNext(new Weighted <TRecord>[] { new Weighted <TRecord>(record, weight) });
 }