Exemple #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);
                }
            }
        }
Exemple #2
0
        /// <summary>
        ///     Common method to reply help for Murphy type MurphyIncomplete (Knowledge, Information, Beliefs)
        /// </summary>
        /// <param name="task"></param>
        /// <param name="blocker"></param>
        /// <param name="medium"></param>
        /// <param name="internalHelp"></param>
        public void ReplyHelpIncomplete(SymuTask task, Blocker blocker, CommunicationMediums medium, bool internalHelp)
        {
            if (task == null)
            {
                throw new ArgumentNullException(nameof(task));
            }

            // Take some time to learn, allocate this time on KeyActivity
            ImpactOfTheCommunicationMediumOnTimeSpent(medium, false, task.KeyActivity);
            task.Recover(blocker, internalHelp ? BlockerResolution.Internal : BlockerResolution.External);
        }