Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Both sides next revision
alvis:modelstate [2013/12/31 09:53]
marcin [Example: Sender - Buffer - Receiver system]
— (current)
Line 1: Line 1:
-====== Model state ====== 
  
-**Definition 1.** A **state** of a model **A** = (//D//, //B//, α^0), where //D// = (//A//, //C//, σ) and //A// = {//X//_1,...,//X//_//n//} is a tuple  
- 
-//S// = (//S//(//X//_1),...,//S//(//X//_//n//)). 
- 
-**Definition 2.** The **initial state** is defined as follows: 
-  * //am//(//X//) = **X**, for any active agent //X// such that σ(//X//) = //True//. 
-  * //am//(//X//) = **I**, for any active agent //X// such that σ(//X//) = //False//. 
-  * //am//(//X//) = **W**, for any passive agent //X//. 
-  * //pc//(//X//) = 1 for any active agent //X// in the **running** mode and //pc//(//X//) = 0 for other agents. 
-  * //ci//(//X//) = [ ] for any active agent //X//. 
-  * //ci//(//X//) contains names of all accessible procedures of //X// together with the direction of parameters transfer, e.g. //in//(//a//), //out//(//b//), etc. for any passive agent //X//. 
-  * For any agent //X//, //pv//(//X//) contains //X// parameters with their initial values. 
- 
-===== Example: Sender - Buffer - Receiver system ===== 
- 
-{{ :alvis:rbs.png?nolink |}} 
- 
-<code> 
-agent Sender { 
-  loop {                 -- 1 
-    out put;             -- 2 
-  } 
-} 
- 
-agent Buffer { 
-  i :: Int = 0; 
-  proc (i == 0) put {  
-    in put;              -- 1 
-    i = 1;               -- 2 
-  } 
-  proc (i /= 0) get {  
-    out get;             -- 3 
-    i = 0;               -- 4 
-  } 
-} 
- 
-agent Receiver { 
-  loop {                 -- 1 
-    in get;              -- 2 
-  } 
-} 
-</code> 
- 
- 
-**Initial state:** 
-  S_0 = ((X,1,[],()), (W,0,[in(put)],(0)), (X,1,[],())) 
- 
-**[[:alvis:manual|Go back]]**