Пример #1
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 agent = new PersonAgent(environment, template);

            agent.Initialize();
            return(agent);
        }
Пример #2
0
        public override void SetAgents()
        {
            base.SetAgents();

            var group = GroupAgent.CreateInstance(this);

            Internet = InternetAccessAgent.CreateInstance(this, ExampleMainOrganization.Templates.Internet);
            for (var j = 0; j < ExampleMainOrganization.WorkersCount; j++)
            {
                var actor = PersonAgent.CreateInstance(this, ExampleMainOrganization.Templates.Human);
                actor.GroupId = group.AgentId;
                var email = EmailEntity.CreateInstance(ExampleMainOrganization.ArtifactNetwork, MainOrganization.Models);
                ActorResource.CreateInstance(ExampleMainOrganization.ArtifactNetwork.ActorResource, actor.AgentId, email.EntityId, new ResourceUsage(0));
                ActorOrganization.CreateInstance(ExampleMainOrganization.ArtifactNetwork.ActorOrganization, actor.AgentId, group.AgentId);
            }
        }