private static void NormalizeList(List <TransitionSpreadDistribution> tsdList)
        {
            tsdList.Sort((TransitionSpreadDistribution tsd1, TransitionSpreadDistribution tsd2) =>
            {
                return(tsd1.MaximumDistance.CompareTo(tsd2.MaximumDistance));
            });

            double TotalRelativeAmount = 0.0;

            for (int Index = 0; Index < tsdList.Count; Index++)
            {
                TransitionSpreadDistribution tsd = tsdList[Index];

                if (Index > 0)
                {
                    tsd.MinimumDistance = tsdList[Index - 1].MaximumDistance;
                }

                TotalRelativeAmount += tsd.RelativeAmount;
            }

            foreach (TransitionSpreadDistribution tsd in tsdList)
            {
                tsd.Proportion = tsd.RelativeAmount / TotalRelativeAmount;
            }
        }
        public void AddItem(TransitionSpreadDistribution tsd)
        {
            SortedKeyMap2 <List <TransitionSpreadDistribution> > m = this.m_Map.GetItemExact(tsd.StratumId, tsd.StateClassId);

            if (m == null)
            {
                m = new SortedKeyMap2 <List <TransitionSpreadDistribution> >(SearchMode.ExactPrev);
                this.m_Map.AddItem(tsd.StratumId, tsd.StateClassId, m);
            }

            List <TransitionSpreadDistribution> l = m.GetItemExact(tsd.Iteration, tsd.Timestep);

            if (l == null)
            {
                l = new List <TransitionSpreadDistribution>();
                m.AddItem(tsd.Iteration, tsd.Timestep, l);
            }

            l.Add(tsd);

            if (!this.m_Lists.Contains(l))
            {
                this.m_Lists.Add(l);
            }
        }