예제 #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
 public bool Equals(Weighted <T> that)
 {
     return(this.weight == that.weight && this.record.Equals(that.record));
 }
예제 #6
0
 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));
 }