Esempio n. 1
0
        /// <summary>
        ///     Clone agent taskLimits from this global model TasksLimit
        /// </summary>
        /// <param name="agentTasksLimit">taskLimit to set</param>
        public void SetAgentTasksLimit(TasksLimit agentTasksLimit)
        {
            if (agentTasksLimit is null)
            {
                throw new ArgumentNullException(nameof(agentTasksLimit));
            }

            if (!LimitSimultaneousTasks)
            {
                agentTasksLimit.LimitSimultaneousTasks = false;
            }
            else
            {
                agentTasksLimit.MaximumSimultaneousTasks =
                    Math.Min(agentTasksLimit.MaximumSimultaneousTasks, MaximumSimultaneousTasks);
            }

            if (!LimitTasksInTotal)
            {
                agentTasksLimit.LimitTasksInTotal = false;
            }
            else
            {
                agentTasksLimit.MaximumTasksInTotal =
                    Math.Min(agentTasksLimit.MaximumTasksInTotal, MaximumTasksInTotal);
            }
        }
Esempio n. 2
0
        public void CopyTo(TasksLimit tasksLimit)
        {
            if (tasksLimit is null)
            {
                throw new ArgumentNullException(nameof(tasksLimit));
            }

            tasksLimit.LimitSimultaneousTasks   = LimitSimultaneousTasks;
            tasksLimit.MaximumSimultaneousTasks = MaximumSimultaneousTasks;
            tasksLimit.LimitTasksInTotal        = LimitTasksInTotal;
            tasksLimit.MaximumTasksInTotal      = MaximumTasksInTotal;
            tasksLimit.OverCommitmentRatio      = OverCommitmentRatio;
        }