Differences

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

Link to this comparison view

Next revision
Previous revision
Both sides next revision
alvis:sbrexample [2013/12/31 10:03]
marcin created
alvis:sbrexample [2021/09/23 08:51] (current)
Line 1: Line 1:
 ====== Example: Sender-Buffer-Receiver system ====== ====== Example: Sender-Buffer-Receiver system ======
 +
 +Agent //S// (sender) puts sequentially valueless signals to the buffer (agent //B//) and agent //R// (receiver) gets such signals from the buffer. Agent //B// offers two procedures (services, ports) to connected agents. 
  
 {{ :alvis:rbs.png?nolink |}} {{ :alvis:rbs.png?nolink |}}
  
 <code> <code>
-agent Sender +agent 
-  loop {                 -- 1   comments contain steps numbers +  loop {                -- 1   comments contain steps numbers 
-    out put;             -- 2+    out put;            -- 2
   }   }
 } }
  
-agent Buffer {+agent {
   i :: Int = 0;   i :: Int = 0;
   proc (i == 0) put {    proc (i == 0) put { 
     in put;              -- 1     in put;              -- 1
     i = 1;               -- 2     i = 1;               -- 2
 +    exit;                -- 3
   }   }
   proc (i /= 0) get {    proc (i /= 0) get { 
-    out get;             -- 3 +    out get;             -- 4 
-    i = 0;               -- 4+    i = 0;               -- 
 +    exit;                -- 6
   }   }
 } }
  
-agent Receiver {+agent {
   loop {                 -- 1   loop {                 -- 1
     in get;              -- 2     in get;              -- 2
Line 30: Line 34:
  
  
-**FIXME**+{{ :alvis:sbrlts.png?500 |}} 
  
-**[[:alvis:manual|Go back]]**