3.1. Hierarchical Goal Model
In our previous work, we developed the hybrid control system with STRIPS (Stanford Research Institute Problem Solver) and BSN (Behavior Selection Network) for smart homes [
28]. In this paper, we improve the system using the hierarchical goal model.
Figure 2 shows the overview of the hierarchical intention model in reference to Hamilton’s model. In the model, the immediate goal consists of one object, which is a device that can be adjusted by the agent in smart homes. The task goal consists of a set of immediate goals. There is a one to one correspondence between goal and intention.
Definition 1. Global environment expresses the state of devices for making the sequence of immediate goals.
Definition 2. Task goal is when the user wants this goal by private intention. It decides what kind of global environment is needed and what kind of immediate goal is pushed to the sequence queue that saves the sequence of the immediate goal in the current global environment to achieve the task goal.
Definition 3. Local environment represents the information that changes frequently when the action in the immediate goal is performed. The global environments decide whether to execute the immediate goal or not; on the other hand, the local environments decide the actions that achieve the immediate goal.
Definition 4. Immediate goal is when the user wants this goal for the immediate intention.
The physical layer is composed of simple sensors used to collect information of interest from the environment. Above the said layer, there is the gateway that handles sensor information and sends the response commands to the physical layer. The information processed by the gateway is essential for the intention handling module, which is responsible for recognizing user intention.
Table 3 shows the task goal of the proposed system, which has three task goals, each of which has a sub-immediate goal, as shown in
Figure 2. Note that energy saving is one of the main task goals, but the proposed system is mainly focused on providing appropriate services to the users rather than saving the energy in smart homes. We need further studies on this aspect in the future work.
Table 4 shows the immediate goal of the proposed system, which consists of various actions. In the table, an underlined action means to perform the same movement in different immediate goals. We define the three task goals and five immediate goals for the proposed smart home agent system. These specifications can be utilized for the rule-based systems, but our system has implemented them with flexible behavior selection networks in a hierarchical way as described in the following section.
3.3. Action Selection
This section presents how the response is selected for the intentions.
Figure 4 shows the flowchart for generating the actions of the agent. First, when the user intention is sent to the response module, it is classified as private or immediate. If the user intention is private, it is sent to the task intention response module for dividing some sub-immediate goals. The system checks if the effect has satisfied all preconditions. If such an action exists, the effect is executed.
When the effect is excitable, the name of the immediate goal module is pushed into a sequence queue . If an action that satisfies all preconditions does not exist, the planner sends an error message to the gateway. When the process of the planner is completed, the immediate goal modules are executed depending on the sequence until there is no more immediate goal. When the user intention is immediate or if the sequence is situated, the response modules are conducted in the immediate intention response module. First, the system searches for the immediate goal module that maps the name of the task or simple intention. If the task module exists, the system classifies executable actions in the module. The executable action at time t is calculated by Equation (4).
Then, the module calculates each response level
using Equation (5). The response level at time
t is defined with reference to the activation level in BSN.
where
and
are backward spreading, forward spreading and delete spreading to
from
, respectively.
Finally, the system selects one action and sends it to the gateway. Equation (9) represents how to select the action. If the response level of the action is the same, the system selects the action randomly.
Figure 5 shows an example of achieving the task goal. Suppose that the user requests “Saving energy”. It is a private intention, which consists of the effect from
to
: “Get_info (TV)”, “Get_info (Radio)”, “Get_info (Light)”, “Control (TV)”, “Pass (TV)”, “Control (Radio)”, “Pass (Radio)”, “Control (Light)”, “Pass (Light)” and “Finish (Saving energy)”. In the figure, there are 12 global environments: “Save”, “TV”, “TV_On”, “TV_Off”, “Radio”, “Radio_On”, “Radio_Off”, “Light”, “Light_On”, “Light_Off”, “Finish_TV”, “Finish_Radio” and “Finish_Light”. In
Figure 5, the table shows the change of general environments. Equation (10) represents the task goal “Saving energy,”
.
The user requests “Saving energy”, and only general environment
has the value of one at Time 1. As the general environment “Save” represents the preconditions of
and
, we can calculate the executable effects at Time 1 using Equation (11).
Finally, the system selects the effect “Get_info (TV)” in the executable effects, because the system selects one effect randomly when it has more than two executable effects. Equation (11) shows the calculation result of the effect “Get_info (TV)” at Time 1. The system selects the effect “Control (TV)” in the executable effects at Time 2 and pushes the name of the immediate goal (TV) into the sequence queue. After executing “Control (TV),” the state of general environments and changes into one. At Time 4, the system selects the effect “Pass (Radio)” and does not push the name of the immediate goal (Radio) into the sequence queue. After performing the making sequence process from Times 1–7, the system makes the sequence which consists of “Immediate goal (TV)” and “Immediate goal (Light)”.
The immediate goal modules are executed by the order of the sequence. First, the system executes “immediate goal module (TV)”. The bottom of
Figure 5 shows the change of response levels in the system. In this figure, the response node is selected four times. At Time 6, the system selects the “Turning off light in living room” response node, and the agent sends the relevant response behavior to the user. Next, the “Checking problem” response node is selected. Then, the “Turning off TV in living room” response node and the “Checking problem” response node in “TV management” are selected consecutively. The “Checking problem” response node is a common node in specific task modules. The system identifies the problem of whether the response is performed or not in the real world using each response node in the two modules.
Figure 6 represents one of the immediate goal modules, which consists of 12 local environments and eight actions.