コード例 #1
0
        /// <summary>
        /// Initializes the agent
        /// </summary>
        /// <param name="desires">The initial list of desires of the agent</param>
        /// <param name="intentions">The initial current intentions of the agent</param>
        /// <returns>A task in which the agent loop is run</returns>
        public virtual Task Init(List <Desire <TAction, TAgent, TEnvironment> > desires, List <Intention <TAction, TAgent, TEnvironment> > intentions)
        {
            if (desires != null)
            {
                Desires.AddRange(desires);
                foreach (var desire in desires)
                {
                    desire.Agent = this;
                }
            }

            if (intentions != null)
            {
                CurrentIntentions.AddRange(intentions);
            }

            return(StartRun());
        }