Exemplo n.º 1
0
        /// <summary>
        ///     Missing belief is guessed
        ///     The worker possibly complete the task incorrectly
        ///     and learn by doing
        /// </summary>
        /// <param name="task"></param>
        /// <param name="blocker"></param>
        /// <param name="murphy"></param>
        /// <param name="resolution"></param>
        public void RecoverBlockerIncompleteByGuessing(SymuTask task, Blocker blocker, MurphyIncomplete murphy,
                                                       BlockerResolution resolution)
        {
            if (task is null)
            {
                throw new ArgumentNullException(nameof(task));
            }

            if (murphy == null)
            {
                throw new ArgumentNullException(nameof(murphy));
            }

            var impact = murphy.NextGuess();

            if (impact > task.Incorrectness)
            {
                task.Incorrectness = impact;
            }

            if (task.Incorrectness == ImpactLevel.Blocked)
            {
                //Agent decide to cancel the task
                TaskProcessor.Cancel(task);
            }
            else
            {
                task.Weight *= murphy.NextImpactOnTimeSpent();
                if (blocker != null)
                {
                    task.Recover(blocker, resolution);
                }
            }
        }