コード例 #1
0
        public void Send(Weighted <R> record)
        {
            Logging.Info("[BMRS {1}] Sending record: {0}", record, this.name);
            long value  = 0;
            bool exists = this.lastEpochAccumulation.TryGetValue(record.record, out value);

            if (exists && value + record.weight == 0)
            {
                this.lastEpochAccumulation.Remove(record.record);
            }
            else
            {
                this.lastEpochAccumulation[record.record] = value + record.weight;
            }
        }
コード例 #2
0
 private void DeferredSend(Weighted <R> record)
 {
     if (record.weight < 0)
     {
         for (int i = 0; i < -record.weight; ++i)
         {
             this.collection.Remove(record.record);
         }
     }
     else
     {
         for (int i = 0; i < record.weight; ++i)
         {
             this.collection.Add(record.record);
         }
     }
 }
コード例 #3
0
 public void Send(Weighted <R> record)
 {
     Console.Error.WriteLine("Got!: {0}", record);
     this.buffer.Add(record);
 }
コード例 #4
0
 public void Send(Weighted <R> record)
 {
     Debug.Assert(record.weight == -1 || record.weight == 1);
     this.buffer.Add(record);
 }
コード例 #5
0
ファイル: CoreGenerics.cs プロジェクト: sherryshare/Naiad
 public bool Equals(Weighted <T> that)
 {
     return(this.weight == that.weight && this.record.Equals(that.record));
 }
コード例 #6
0
ファイル: InputCollection.cs プロジェクト: sherryshare/Naiad
 public void OnCompleted(Weighted <R> value)
 {
     inputVertex.OnCompleted(value);
 }
コード例 #7
0
 internal static NaiadRecord <S, T> ToNaiadRecord <S, T>(this Weighted <S> x, T t)
     where S : IEquatable <S>
     where T : Time <T>
 {
     return(new NaiadRecord <S, T>(x.record, x.weight, t));
 }