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:cases:ats [2011/04/10 16:22]
marcin
alvis:cases:ats [2021/09/23 08:51] (current)
Line 45: Line 45:
   }    } 
 } }
 +</code>
  
 +
 +====== Automatic Train Stop System - version 2 ======
 +
 +===== Files =====
 +
 +  * {{:alvis:cases:ats2.alvis|Alvis model}}
 +  * {{:alvis:cases:ats2e.dot|LTS graph}}
 +
 +===== Model =====
 +
 +{{:alvis:cases:ats2.png|}}
 +
 +<code>
 +environment {
 +  in off [] (map (1000*) [1..]) signal;
 +  out brake [] [];  
 +}
 +
 +agent ATS {
 +  loop {
 +    in wakeup;
 +    out warning 1;
 +    select {
 +      alt (ready [in(off)]) {
 +        in off;
 +        out warning 0; 
 +      }
 +      alt(delay 6000) {
 +        out warning 2;
 +        select {
 +          alt (ready [in(off)]) {
 +            in off;
 +            out warning 0; 
 +          }
 +          alt (delay 3000) {
 +            out brake;
 +            exit; 
 +          } 
 +        } 
 +      } 
 +    } 
 +  } 
 +}
 +
 +agent Timer {
 +  loop (every 6000) {
 +    out tick;
 +  }
 +}
 +
 +agent Console {
 +  state ::Int = 0;
 +  proc setState { in setState state ; }
 +}
 </code> </code>
 +
 +