/// <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); }
/// <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); }
/// <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) { }
/// <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; }
/// <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(); }
/// <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; }
/// <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; }
/// <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); }
/// <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) { }
/// <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) { }
/// <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) { }
/// <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) { }