Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Both sides next revision
alvis:agentstate [2017/01/11 22:44]
marcin removed
— (current)
Line 1: Line 1:
-====== Agent state ====== 
  
-**Definition 1.** A **state of an agent** $X$ is a tuple $S(X) = (am(X), pc(X), ci(X), pv(X))$, 
-where: 
-  * $am(X)$ is **agent mode**, 
-  * $pc(X)$ is **program counter**, 
-  * $ci(X)$ is **context information list**, 
-  * $pv(X)$ is **parameters values**. 
-If necessary $am$, $pc$, $ci$, $pv$ will be indicated by indexes $S$, $S'$ etc. to point out the state they refer to. 
- 
-===== Agent mode ===== 
- 
-All possible modes and transitions among them, for $\alpha^0$ system layer, are shown in Fig. 1.  
-  * **Finished** (**F**) means that an agent has finished its work.  
-  * **Init** (**I**) is the default mode for agents that are inactive in the initial state. 
-  * **Running** (**X**) means that an agent is performing one of its statements.  
-  * **Taken** (**T**) means that one of the passive agent procedures has been called and the agent is executing it. 
-  * For passive agents, **waiting** (**W**) means that the corresponding agent is inactive and waits for another agent to call one of its accessible procedures. For active agents, the mode means that the corresponding agent is waiting either for a communication with another active agent, or for a currently inaccessible procedure of a passive agent.  
- 
- 
-{{:alvis:modes.png|modes}} 
- 
-**Fig. 1. ** Possible transitions among modes: a) active agents, b) passive agents. 
- 
-===== Program counter ===== 
- 
-The **program counter** points out the current statement of an agent i.e. the next statement to be executed or the statement that has been already executed by an agent but needs a feedback from another agent to be completed (e.g. a communication between agents). For active agents in the **init** or **finished** mode and for passive agents in the **waiting** mode, the program counter is equal to 0. 
- 
-We say that:  
-  * $pc(X)$ **points out** an **exec** (**exit**, **jump**, **null**, **start**) statement iff the next statement to be executed is an **exec** (**exit**, **jump**, **null**, **start**) statement;   
-  * $pc(X)$ **points out** a **loop** statement iff the next statement to be executed is the evaluating of the guard (if any) and possibly entering the **loop** statement; 
-  * $pc(X)$ **points out** a **select** statement iff the next statement to be executed is entering the **select** statement and possibly one of its branches; 
-  * $pc(X)$ **points out** an **in** or **out** statement iff the next statement to be executed is an **in** or **out** statement or the last executed statement is **in** or **out** and the agent is waiting for the communication to be completed (either with an active or a passive agent). 
- 
-===== Context information list ===== 
- 
-The context information list contains additional information about the current state of an agent e.g. if an agent is in the **waiting** mode, $ci$ contains information about events the agent is waiting for. Possible entries put into $ci$ lists are given in Table 1. If an agent is in the **init** or **finished** mode, its context information list is empty.  
- 
-**Table 1.** Relationships between the mode and the context information list of an agent. 
- 
-^ agent $X$ ^ $am(X)$ ^ $ci(X)$ entry ^ description ^ 
-| active | **X**, **W** | $proc(Y.b,a)$ | $X$ has called the $Y.b$ procedure via port $a$ and this procedure is being executed in the $X$ agent context | 
-| active | **W** | $in(a)$  $in(a|T)$ | $X$ waits for a communication via port $a$ ($a$ is the input port for the communication); $T$ is the type of the expected value | 
-| active | **W** | $out(a)$  $out(a|T)$ | $X$ waits for a communication via port $a$ ($a$ is the output port for the communication) | 
-| passive | **T** | $in(a)$  $in(a|T)$ | $X$ waits for a communication via port $a$ ($a$ is the input port for the communication) | 
-| passive | **T** | $out(a)$  $out(a|T)$ | $X$ waits for a communication via port $a$ ($a$ is the output port for the communication) | 
-| passive | **T** | $proc(Y.b,a)$ | $X$ has called the $Y.b$ procedure via port $a$ and this procedure is being executed in the same context as $X$ | 
-| passive | **W** | $in(a)$ | input procedure $a$ is accessible | 
-| passive | **W** | $out(a)$ | output procedure $a$ is accessible | 
- 
- 
-===== Parameters values list ===== 
- 
-The **parameters values list** contains the current values of the agent parameters. 
- 
-**[[:alvis:manual|Go back]]**