示例#1
0
        /// <summary>
        ///     Add an agentId's beliefs
        ///     using the beliefLevel
        /// </summary>
        /// <param name="beliefId"></param>
        /// <param name="beliefLevel"></param>
        public void AddBelief(IAgentId beliefId, BeliefLevel beliefLevel)
        {
            if (!On)
            {
                return;
            }

            ActorBelief.CreateInstance(_actorBeliefNetwork, _agentId, beliefId, beliefLevel);
        }
示例#2
0
        /// <summary>
        ///     Agent don't have still this belief, it's time to learn a new one
        /// </summary>
        /// <param name="beliefId"></param>
        /// <param name="beliefLevel"></param>
        public void LearnNewBelief(IAgentId beliefId, BeliefLevel beliefLevel)
        {
            if (_actorBeliefNetwork.Exists(_agentId, beliefId))
            {
                return;
            }

            ActorBelief.CreateInstance(_actorBeliefNetwork, _agentId, beliefId, beliefLevel);
            InitializeBeliefs(true);
        }
示例#3
0
        /// <summary>
        ///     Add an agentId's beliefs based on a knowledgeId to the network
        ///     using the beliefLevel
        /// </summary>
        /// <param name="knowledgeId"></param>
        /// <param name="beliefLevel"></param>
        public void AddBeliefFromKnowledgeId(IAgentId knowledgeId, BeliefLevel beliefLevel)
        {
            if (!On)
            {
                return;
            }

            var belief = GetBeliefFromKnowledgeId(knowledgeId);

            if (belief == null)
            {
                throw new NullReferenceException(nameof(belief));
            }

            ActorBelief.CreateInstance(_actorBeliefNetwork, _agentId, belief.EntityId, beliefLevel);
        }