コード例 #1
0
ファイル: ExampleEnvironment.cs プロジェクト: lmorisse/Symu
        public override void SetAgents()
        {
            base.SetAgents();

            var group = GroupAgent.CreateInstance(this);

            _groupId = group.AgentId;
            for (var j = 0; j < ExampleMainOrganization.WorkersCount; j++)
            {
                AddPersonAgent();
            }
        }
コード例 #2
0
        /// <summary>
        ///     Factory method to create an agent
        ///     Call the Initialize method
        /// </summary>
        /// <returns></returns>
        public static GroupAgent CreateInstance(SymuEnvironment environment)
        {
            if (environment == null)
            {
                throw new ArgumentNullException(nameof(environment));
            }

            var agent = new GroupAgent(environment);

            agent.Initialize();
            return(agent);
        }