public ContainerRateLimit( ITaskParam Task, ITaskRateLimit RateLimit) : this(Task, RateLimit.Yield()) { }
IEnumerable<ITask> EnumRateLimitEffective(ITaskRateLimit RateLimit) { foreach (var Task in (ListTask?.Reversed()).EmptyIfNull()) { var TaskMotionCompleteStepIndexInBot = Task.BeginStepIndexInBot + Task.MotionCompleteStepIndexInTask; if (!TaskMotionCompleteStepIndexInBot.HasValue) { continue; } var DistanceMin = RateLimit?.ToTaskDistanceMinStepCountAndTime(Task); if (!DistanceMin.HasValue) { continue; } var TaskMotionCompleteTime = this.TimeFromStepIndex(TaskMotionCompleteStepIndexInBot.Value); var TaskMotionCompleteAgeStepCount = StepIndex - TaskMotionCompleteStepIndexInBot; var TaskMotionCompleteAgeTime = this.Time() - TaskMotionCompleteTime; if (TaskMotionCompleteAgeStepCount < DistanceMin?.Key || TaskMotionCompleteAgeTime < DistanceMin?.Value) { yield return Task; } } }