Example #1
0
    //Next action in queue
    public void NextAction()
    {
        //If there are still actions or agent hasn't reached the goal, get and start next action. Otherwise change state to COMPLETED plan

        if (actions.Count > 0)
        {
            IGroundAction action = actions.Dequeue();

            currentAction = action;

            //Start action

            action.Start(this, agent.state);
        }
        else if (actions.Count == 0 || RuleMatcher.MatchCondition(agent.goalCondition, agent.state, agent.logicalOperator))
        {
            state         = ManagerState.EMPTY;
            currentAction = null;
        }
    }
Example #2
0
 public void ScheduleAction(IGroundAction action)
 {
     actions.Enqueue(action);
 }