Instance of the era family

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

<era-cfg-path>

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

<events>

List of possible events.

<event>

Event name.

<initial>

Initial state.

<final>

Final state.

<state>

State name

<scale>

Scale of the clock (factor). It is used when computing the condition (<condition>).

<state-declare>

Declaration of the state and transitions from this state.

<transition-func>

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 true.

<condition>

Condition under which the transition will occur. A condition can contain the reserved words true and false, and the following operators: "|", "&", "!", "==", "!=", "<", "<=", ">", ">=", "-".

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 <scale> element. The clock name corresponds to the name of the event to which the clock is linked.

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

}

Page top