예제 #1
0
        /// <summary>
        /// Add new entry. This will cause a re-normalization to happen when the next
        /// value is requested by the user.
        /// </summary>
        /// <param name="entry">Entry to add</param>
        public void Add(WeightedEntry <T> entry)
        {
            Entries.Add(entry);

            // We added a new element, so re-normalization needs to happen.
            NeedsNormalization = true;
        }
예제 #2
0
 protected bool Equals(WeightedEntry <T> other)
 {
     return(Probability.Equals(other.Probability) && EqualityComparer <T> .Default.Equals(Value, other.Value));
 }