public CPEvent(Node node, Team team, DateTime time, EventType eType) { Time = time; Team = team; Node = node; EType = eType; }
/// <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); }
public PhaseTeamInfo GetTeamInfo(Team t) { return Info.FirstOrDefault(i => i.Team == t); }
public void AddTeam(Random r, Team team, DateTime when) { ProcessEvent(r, new CPEvent(this, team, when, EventType.Appear)); }