Using the solution present in Appendix A many situations can occur. In order to test some specific situations, we propose two different scenarios that follow. We will use storyboards to illustrate the overall behavior of the agents.
8.1.3.1. SCENARIO 1
In this first scenario we intend to demonstrate a simple situation using the files of Appendix A and the Taxi 1.
We will assume that it is not a rush hour and there is no traffic on the roads 2 and 3. So the following beliefs (facts) should be added to the belief base (“beliefs.delp”) before the agent starts:
The storyboard (Storyboard A) for this scenario is represented in Figure 33, Figure 34 and Figure 35 by several pictures (from P1 to P10). A brief description of each picture is made, in order to understand the agent’s behavior. The first picture represents the first action from the agent after being connected to the server, as sub-section 7.4 demonstrates.
Now we will take a close look at the “INVALID” answers returned by the server when contradictions occur.
Considering P4 from Figure 33, for example, the contextual query will be “INVALID”, due to the contradictory beliefs 10/12 and 11/13 present in the belief base, at that point:
1.
So the agent will revise its beliefs and the oldest beliefs in conflict will be discarded, i.e. the beliefs 10 and 11 will be removed from the belief base. Then the contextual query will be made again and due to the belief 1 (which is a defeasible rule) the returned answer will be “YES”. This situation is similar to the other situations where “INVALID” answers are returned by the server and illustrates how the agents behave.
74
P1: In this first decision point, the intention is chosen. A contextual query with that intention is made and the answer returned by the server is “YES”, considering the agent’s beliefs.
P2: The action plan ( ) started and the agent waited until passengers appeared. The agent should now pick up the passengers.
P3: A new belief ( ) is added to the belief base. Next, the agent should continue the action plan and move to the next decision point.
P4: A new belief ( ) is added, since the agent is no longer in the taxi rank. The current action plan ends and the next intention is chosen ( ). This is the second decision point, where a contextual query is made, but now the answer from the server is “INVALID” due to the contradictions caused by the previously added beliefs. So the revision process will occur and discard the following beliefs:
and , one at a time, since they are older than their complement. Then, the same contextual query ( ) is made again and now the answer returned by the server is “YES”.
FIGURE 33 - STORYBOARD A
75 P5: The action plan ( ) starts and
the agent will move on Road 1.
P6: During its trip through road 1, it will be checking for traffic. If it finds, then will add the belief , if not, then adds the belief , as in this case.
P7: The agent arrives to a new decision point (airport) after finishing the action plan. A new belief is inserted ( ). The next intention is considered ( ) and a contextual query is submitted to the server. According to the agent’s belief base the answer is “INVALID”, due to the contradictory beliefs and . The agent will revise the beliefs and eliminate The same contextual query will be made to the server and the answer will be “NO”. The intention is discarded and the next intention is considered ( ).
Again, a contextual query is made and the answer from the server is “NO”. The process is repeated and now the intention is warranted by the server with the answer “YES”. The action plan ( ) starts.
P8: During the current action plan, ( ), the agent will, obviously, drop the passengers at the airport, add the new belief and then move to the next decision point.
FIGURE 34 - STORYBOARD A (CONTINUATION)
76
P10: When the agent arrives to this decision point, it will add two new beliefs: and Now the agent will check for another intention, but it will realize that the list is empty. According to the flowchart from the Figure 21, when that happens, the initial intentions’ list is pressed, the agent will turn off.
FIGURE 35 - STORYBOARD A (CONTINUATION)
8.1.3.2. SCENARIO 2
In this second scenario we intend to demonstrate a different situation using the files of Appendix A. We will use the Taxi 1 and the Random agent to symbolize traffic.
We will assume that it is a rush hour and there is no traffic on the roads 2 and 3. So the following beliefs (facts) should be added to the belief base (“beliefs.delp”) before the agent starts:
The storyboard (Storyboard B) for this scenario is represented in Figure 36,Figure 37 and Figure 38 by several pictures (from P1 to P10). A brief description of each picture is made, in order to understand the agent’s behavior. The first picture represents the first action from the agent after being connected to the server, as sub-section 7.4 demonstrates.
77 P1: In this first decision point, the intention
is chosen. A contextual query with that intention is made and the answer returned by the server is “YES”.
P2: The action plan ( ) started and the agent waited until passengers appeared. The agent should now pick up the passengers.
P3: A new belief ( ) is added to the belief base. Next, the agent should continue the action plan and move to the next decision point.
P4: A new belief ( ) is added, since the agent is no longer in the taxi rank. The current action plan ends and the next intention is chosen ( ). This is the second decision point, where a contextual query is made, but now the answer from the server is “INVALID” due to the contradictions caused by the previously added beliefs. So the revision process will occur and discard the following beliefs:
and , one at a time, since they are older than their complement. Then the same contextual query ( ) is made again and now the answer returned by the server is “NO”, since the server can warrant (through a defeasible rule). So, the next intention, , is chosen and warranted by the server.
FIGURE 36 - STORYBOARD B
78
P5: The action plan ( ) starts and the agent will move on Road 2.
P6: During its trip through road 2, the agent will be checking for traffic. If it finds traffic, then it will add the belief , if not, then it adds the belief , as in this case.
P7: The agent arrives to a new decision point (airport) after finishing the action plan. A new belief is inserted ( ). The next intention is considered ( ) and a contextual query is submitted to the server. According to the agent’s belief base the answer is “INVALID”, due to the contradictory beliefs and . The agent will revise the beliefs and eliminate The same contextual query will be made to the server and the answer will be “NO”. The intention is discarded and the next intention is considered ( ) and is warranted by the server since the answer is
“YES”. The action plan ( ) starts.
P8: During the current action plan, ( ), the agent will, obviously, drop the passengers at the airport, add the new belief and then move to the next decision point.
FIGURE 37 - STORYBOARD B (CONTINUATION)
79
P10: When the agent arrives to this decision point, it will add two new beliefs: and Now the agent will check for another intention, but it will realize that the list is empty. According to the flowchart from the Figure 21, when that happens, the initial intentions’ list is pressed the agent will turn off.
FIGURE 38 - STORYBOARD B (CONTINUATION)