All events, states and transition functions are described in the era
family configuration file. The path to the file is specified in the family instance configuration. Each event has its own clock that records the time that has passed since the last occurrence of the event.
Family instance configuration
<family-configuration> ::= <era-cfg-path>
Family instance configuration elements
|
Path to the automata description file. |
Syntax of the era family configuration file
<era-cfg> ::= <events> ","
<initial> ","
[<final> ","]
<scale> ","
{<state-declare> ","}
<events> ::= "events" ":" "[" <event> {"," <event>} "]"
<initial> ::= "initial" ":" <state>
<final> ::= "final" ":" <state>
<scale> ::= "scale" ":" <scale-value>
<state-declare> ::= <state> ":" "{"
<transition-func>
{"," <transition-func>}
"}"
<transition-func> ::=
<event> ":" <state> ["if" <condition>]
Elements of the era family configuration file
|
List of possible events. |
|
Event name. |
|
Initial state. |
|
Final state. |
|
State name |
|
Scale of the clock (factor). It is used when computing the condition ( |
|
Declaration of the state and transitions from this state. |
|
Transition function. This is described by an event, state, and optional condition. There will be a transition to the specified state when the event occurs. If a condition is specified, the transition will take place only if the condition returns the value |
|
Condition under which the transition will occur. A condition can contain the reserved words Clocks and numbers can be used in a condition. When the condition is computed, the values of numbers will be multiplied by the clock scale specified in the |
Example
security.cfg
...
#include "kss/server/era.cfg"
/* era0 – example instance of the "era" family. */
use family era0 = era "test.era";
...
test.era
events : [request, response],
initial : start,
final : stop,
scale : 10 msec,
start : {
/* when the "request" event occurs,
there will be a transition to the process state */
request : process
},
process : {
/* A transition to the stop state will occur
if the clock value of the "request" event is more than
20 msec, i.e. the last "request" event occurred
more than 20 msec ago. */
response : stop if request > 2
}