Exemple #1
0
        /// <summary>
        /// Initialises the drive collection.
        /// 
        /// The log domain is set to [AgentId].DC.[collection_name]
        /// 
        /// If no goal is given (goal = None), then it can never be satisfied.
        /// </summary>
        /// <param name="agent">The collection's agent.</param>
        /// <param name="collectionName">The name of the drive collection.</param>
        /// <param name="priorityElements">The drive elements in order of their
        ///         priority, starting with the highest priority.</param>
        /// <param name="goal">The goal of the drive collection.</param>
        public DriveCollection(Agent agent, string collectionName, DrivePriorityElement [] priorityElements, Trigger goal)
            : base(string.Format( "DC.{0}", collectionName),agent)
        {
            name = collectionName;
            elements = priorityElements;
            this.goal = goal;

            log.Debug("Created");
        }
Exemple #2
0
        /// <summary>
        /// Initialises the competence element.
        /// 
        /// The log domain is set to [AgentName].CE.[element_name].
        /// </summary>
        /// <param name="agent">The competence element's agent.</param>
        /// <param name="elementName">The name of the competence element.</param>
        /// <param name="trigger">The element's trigger</param>
        /// <param name="element">The element to fire (Action,Competence or ActionPattern).</param>
        /// <param name="maxRetries">The maximum number of retires. If this is set
        ///         to a negative number, it is ignored.</param>
        public CompetenceElement(Agent agent, string elementName, Trigger trigger, CopiableElement element, int maxRetries)
            : base(string.Format("CE.{0}",elementName),agent)
        {
            this.name = elementName;
            this.trigger = trigger;
            this.element = element;
            this.maxRetries = maxRetries;
            this.retries = 0;

            log.Debug("Created");
        }
Exemple #3
0
        /// <summary>
        /// A POSH competence, containing competence priority elements.
        /// 
        /// Initialises the competence.
        /// 
        /// If no goal is given, then the goal will never be reached.
        /// 
        /// The log domain is set to "[AgentId].C.[competence_name]".
        /// </summary>
        /// <param name="agent">The competence's agent.</param>
        /// <param name="competenceName">The name of the competence.</param>
        /// <param name="priorityElements">The priority elements of the competence,
        ///         in their order of priority.</param>
        /// <param name="goal">The goal of the competence.</param>
        public Competence(Agent agent, string competenceName, CompetencePriorityElement[] priorityElements, Trigger goal)
            : base(string.Format("C.{0}",competenceName),agent)
        {
            this.name = competenceName;
            if (priorityElements.Length > 0 )
                this.elements = new List<CompetencePriorityElement>(priorityElements);
            else
                this.elements = new List<CompetencePriorityElement>();
            this.goal = goal;

            log.Debug("Created");
        }