示例#1
0
文件: Modeler.cs 项目: se-ti/queueing
 public CPEvent(Node node, Team team, DateTime time, EventType eType)
 {
     Time = time;
     Team = team;
     Node = node;
     EType = eType;
 }
示例#2
0
文件: Phase.cs 项目: se-ti/queueing
        /// <param name="r">генератор равномерно распределенных случайных чисел</param>
        /// <param name="t">командаб t.Smartness -- коэффициент быстроходности / тормознутости t.Members -- число человек</param>
        /// <returns></returns>
        protected TimeSpan NextMoment(Random r, Team t)
        {
            // this.Times -- характеристики этапа Min, Mean, Max, Sigma

            double minutes = GetNormalDistibutedRandom(r, Times.Mean.TotalMinutes * t.Smartness, Times.Sigma);

            if (minutes < Times.Min.TotalMinutes)
                minutes = Times.Min.TotalMinutes;

            if (minutes < 0.0)
                minutes = 0.0;

            return new TimeSpan(0, Convert.ToInt32(minutes), 0);
        }
示例#3
0
文件: Phase.cs 项目: se-ti/queueing
 public PhaseTeamInfo GetTeamInfo(Team t)
 {
     return Info.FirstOrDefault(i => i.Team == t);
 }
示例#4
0
文件: Phase.cs 项目: se-ti/queueing
 public void AddTeam(Random r, Team team, DateTime when)
 {
     ProcessEvent(r, new CPEvent(this, team, when, EventType.Appear));
 }