示例#1
0
        /// <summary>
        ///     Factory method to create an agent
        ///     Call the Initialize method
        /// </summary>
        /// <returns></returns>
        public static LearnAgent CreateInstance(SymuEnvironment environment, CognitiveArchitectureTemplate template)
        {
            if (environment == null)
            {
                throw new ArgumentNullException(nameof(environment));
            }

            var agent = new LearnAgent(environment, template);

            agent.Initialize();
            return(agent);
        }
示例#2
0
        /// <summary>
        ///     Factory method to create an agent
        ///     Call the Initialize method
        /// </summary>
        /// <returns></returns>
        public static PersonAgent CreateInstance(SymuEnvironment environment, CognitiveArchitectureTemplate template)
        {
            if (environment == null)
            {
                throw new ArgumentNullException(nameof(environment));
            }

            var entity = new ActorEntity(environment.MainOrganization.ArtifactNetwork);
            var agent  = new PersonAgent(entity.EntityId, environment, template);

            agent.Initialize();
            return(agent);
        }
示例#3
0
 /// <summary>
 ///     Constructor of the agent
 /// </summary>
 /// <remarks>Call the Initialize method after the constructor, or call the factory method</remarks>
 private PersonAgent(IAgentId entityId, SymuEnvironment environment,
                     CognitiveArchitectureTemplate template) : base(
         entityId, environment, template)
 {
 }
示例#4
0
 /// <summary>
 ///     Constructor with specific agentTemplate
 /// </summary>
 /// <param name="agentId"></param>
 /// <param name="environment"></param>
 /// <param name="template"></param>
 /// <remarks> Make constructor private and create a factory method to create an agent that call the Initialize method</remarks>
 protected CognitiveAgent(IAgentId agentId, SymuEnvironment environment, CognitiveArchitectureTemplate template)
     : base(agentId, environment)
 {
     _cognitiveTemplate = template;
 }
示例#5
0
 /// <summary>
 ///     Constructor of the agent
 /// </summary>
 /// <remarks>Call the Initialize method after the constructor, or call the factory method</remarks>
 protected LearnAgent(SymuEnvironment environment, CognitiveArchitectureTemplate template) : base(
         ClassId, environment, template)
 {
     Wiki      = MainOrganization.WikiEntity;
     Knowledge = GetKnowledge();
 }
示例#6
0
 /// <summary>
 ///     Constructor with specific agentTemplate
 /// </summary>
 /// <param name="classId"></param>
 /// <param name="environment"></param>
 /// <param name="template"></param>
 /// <remarks> Make constructor private and create a factory method to create an agent that call the Initialize method</remarks>
 protected CognitiveAgent(IClassId classId, SymuEnvironment environment, CognitiveArchitectureTemplate template)
     : this(environment?.AgentNetwork.NextAgentId(classId), environment, template)
 {
     _cognitiveTemplate = template;
 }
示例#7
0
 /// <summary>
 ///     Constructor with standard agent template
 ///     and with an existing IAgentId
 /// </summary>
 /// <param name="agentId"></param>
 /// <param name="environment"></param>
 /// <remarks> Make constructor private and create a factory method to create an agent that call the Initialize method</remarks>
 protected CognitiveAgent(IAgentId agentId, SymuEnvironment environment) : base(agentId, environment)
 {
     _cognitiveTemplate = environment.MainOrganization.Templates.Standard;
 }
示例#8
0
 /// <summary>
 ///     Clone the cognitive architecture of the agent
 ///     Applying AgentTemplate
 /// </summary>
 /// <param name="agentTemplate"></param>
 protected void SetTemplate(CognitiveArchitectureTemplate agentTemplate)
 {
     Cognitive = new CognitiveArchitecture();
     //Apply Cognitive template
     agentTemplate?.Set(Cognitive);
 }
示例#9
0
 /// <summary>
 ///     Constructor of the agent
 /// </summary>
 /// <remarks>Call the Initialize method after the constructor, or call the factory method</remarks>
 private LearnByAskingAgent(SymuEnvironment environment, CognitiveArchitectureTemplate template)
     : base(environment, template)
 {
 }
示例#10
0
 /// <summary>
 ///     Constructor of the agent
 /// </summary>
 /// <remarks>Call the Initialize method after the constructor, or call the factory method</remarks>
 private PersonAgent(SymuEnvironment environment, CognitiveArchitectureTemplate template) : base(
         ClassId, environment, template)
 {
 }
示例#11
0
 /// <summary>
 ///     Constructor of the agent
 /// </summary>
 /// <remarks>Call the Initialize method after the constructor, or call the factory method</remarks>
 private InternetAccessAgent(SymuEnvironment environment,
                             CognitiveArchitectureTemplate template) : base(
         ClassId, environment, template)
 {
 }
示例#12
0
 /// <summary>
 ///     Constructor of the agent
 /// </summary>
 /// <remarks>Call the Initialize method after the constructor, or call the factory method</remarks>
 private LearnFromSourceAgent(SymuEnvironment environment,
                              CognitiveArchitectureTemplate template) : base(environment, template)
 {
 }