Exemple #1
0
        public void LearnByDoingTest0()
        {
            _learningModel.On = false;
            var actorKnowledge = new ActorKnowledge(Network.ActorKnowledge, _agentId, _knowledge.EntityId, new float[] { 0 }, 0, -1);
            var realLearning   = _learningModel.LearnByDoing(_knowledge.EntityId, 0, 0, -1, 0);

            Assert.AreEqual(0, actorKnowledge.GetKnowledgeSum());
            Assert.AreEqual(0, realLearning);
        }
Exemple #2
0
        /// <summary>
        ///     Missing knowledge is guessed or searched in agent's databases
        ///     The worker possibly complete the task incorrectly
        ///     and learn by doing
        /// </summary>
        /// <param name="task"></param>
        /// <param name="knowledgeId"></param>
        /// <param name="knowledgeBit"></param>
        /// <param name="blocker"></param>
        /// <param name="resolution">guessing or searched</param>
        public void RecoverBlockerIncompleteKnowledgeByGuessing(SymuTask task, Blocker blocker, IAgentId knowledgeId,
                                                                byte knowledgeBit, BlockerResolution resolution)
        {
            if (task is null)
            {
                throw new ArgumentNullException(nameof(task));
            }

            RecoverBlockerIncompleteByGuessing(task, blocker, Environment.MainOrganization.Murphies.IncompleteKnowledge,
                                               resolution);
            if (task.Incorrectness == ImpactLevel.Blocked)
            {
                return;
            }

            LearningModel.LearnByDoing(knowledgeId, knowledgeBit, Schedule.Step);
            switch (blocker)
            {
            // No blocker, it's a required knowledgeBit
            case null:
                task.KnowledgesBits.RemoveFirstRequired(knowledgeId);
                // Blockers Management - no blocker has been created
                break;

            // blocker, it's a mandatory knowledgeBit
            default:
                task.KnowledgesBits.RemoveFirstMandatory(knowledgeId);
                break;
            }
        }