Exemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="agentId"></param>
        /// <param name="models"></param>
        /// <param name="knowledgeNetwork"></param>
        /// <param name="entityKnowledgeNetwork">ActorKnowledgeNetwork, ResourceKnowledgeNetwork depending on the agent</param>
        /// <param name="cognitiveArchitecture"></param>
        /// <param name="model"></param>
        /// <param name="randomLevel"></param>
        public LearningModel(IAgentId agentId, MainOrganizationModels models, OneModeNetwork knowledgeNetwork,
                             TwoModesNetwork <IEntityKnowledge> entityKnowledgeNetwork,
                             CognitiveArchitecture cognitiveArchitecture, RandomGenerator model, byte randomLevel)
        {
            if (models == null)
            {
                throw new ArgumentNullException(nameof(models));
            }

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

            models.Learning.CopyTo(this);
            _agentId                 = agentId;
            TasksAndPerformance      = cognitiveArchitecture.TasksAndPerformance;
            _internalCharacteristics = cognitiveArchitecture.InternalCharacteristics;
            _knowledgeNetwork        = knowledgeNetwork;
            _entityKnowledgeNetwork  =
                entityKnowledgeNetwork ?? throw new ArgumentNullException(nameof(entityKnowledgeNetwork));
            _randomLevel = randomLevel;
            if (!cognitiveArchitecture.InternalCharacteristics.CanLearn ||
                !cognitiveArchitecture.KnowledgeAndBeliefs.HasKnowledge)
            {
                // Agent is not concerned by this model
                On = false;
            }

            _model = model;
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Initialize Knowledge model :
        ///     update NetworkKnowledges
        /// </summary>
        /// <param name="agentId"></param>
        /// <param name="entity"></param>
        /// <param name="cognitiveArchitecture"></param>
        /// <param name="network"></param>
        /// <param name="model"></param>
        public KnowledgeModel(IAgentId agentId, KnowledgeModelEntity entity,
                              CognitiveArchitecture cognitiveArchitecture,
                              GraphMetaNetwork network, RandomGenerator model)
        {
            if (entity is null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

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

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

            On                     = entity.IsAgentOn();
            _agentId               = agentId;
            _knowledgeNetwork      = network.Knowledge;
            _actorKnowledgeNetwork = network.ActorKnowledge;
            _knowledgeAndBeliefs   = cognitiveArchitecture.KnowledgeAndBeliefs;
            _messageContent        = cognitiveArchitecture.MessageContent;
            _model                 = model;
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Initialize influence model :
        ///     update networkInfluences
        /// </summary>
        /// <param name="agentId"></param>
        /// <param name="cognitiveArchitecture"></param>
        /// <param name="network"></param>
        public ActorTaskModel(IAgentId agentId, CognitiveArchitecture cognitiveArchitecture, GraphMetaNetwork network)
        {
            if (cognitiveArchitecture == null)
            {
                throw new ArgumentNullException(nameof(cognitiveArchitecture));
            }

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

            _agentId          = agentId;
            _actorTaskNetwork = network.ActorTask;
            _taskNetwork      = network.Task;
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Initialize Beliefs model :
        ///     update NetworkBeliefs
        /// </summary>
        /// <param name="agentId"></param>
        /// <param name="entity"></param>
        /// <param name="cognitiveArchitecture"></param>
        /// <param name="network"></param>
        /// <param name="model"></param>
        public BeliefsModel(IAgentId agentId, BeliefModelEntity entity, CognitiveArchitecture cognitiveArchitecture,
                            GraphMetaNetwork network, RandomGenerator model)
        {
            if (network == null)
            {
                throw new ArgumentNullException(nameof(network));
            }

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

            _agentId             = agentId;
            _beliefNetwork       = network.Belief;
            _actorBeliefNetwork  = network.ActorBelief;
            _knowledgeAndBeliefs = cognitiveArchitecture.KnowledgeAndBeliefs;
            _messageContent      = cognitiveArchitecture.MessageContent;
            _model = model;
            Entity = entity ?? throw new ArgumentNullException(nameof(entity));
        }