• CN (respectively, EN) is a set of condition
(respectively, event) signals with CN ⊆ (P × T)
(respectively, EN ⊆(T × T)),
• DC: F (P ×T) → {[l, h ]} is a superset of time
constraints on output arcs,
• V: T →{∨, ∧} maps an event-processing mode
(AND or OR) to each transition,
• Z
0
= (T0, D
0
) where T
0
: P →{0, 1} is the initial
marking and D0 : P →{0} is the initial clock
position.
Let TN = P ×T ×F ×W × CN × EN × DC × V
be the set of all feasible net structures that can be
performed by a system. Given a TNCES:
β=(P’,T’,F’,W’,CN’,V’, DC’
,Z’0), TN(β) = (P’, T’,
F’ , W’, CN’, EN’, DC’, V’) denotes its net
structure, where TN(β) ∈ ∑ TN. We have P’ ⊆ P, T’
⊆ T, F’ ⊆ F, W’⊆ W, CN’ ⊆ CN, EN’⊆ EN, DC’ ⊆
DC, and ∀t ∈ T, V’ (t) =V (t). Each reconfiguration
is controlled by the controller. It is a structure:
R = {Condition Cond, Probability P
0
’, Energy E’,
Memory M’, Structure S, State X}
Let
•r (respectively, r•) denotes the original
(respectively, target) TNCES before (respectively,
after) the reconfiguration function r is applied, where
TN(
•r), TN(r•) ∈ ∑ TN. A reconfiguration function r
is a structure r = (Cond, P
0
, E, M, S, X). A
reconfiguration r is enabled at a state if the following
conditions are fulfilled.
Cond → {true, false}: the precondition of r,
P
0
’: P
0
: F→ [0..1] TNCES probability which
could be a functional (internal to the TNCES) or a
reconfiguration probability,
E
0
’: P→ [0..max] : controls the energy
requirements by the TNCES to token number of
energy in the controller, else the second
reconfiguration probability is chosen,
M
0
’ : P → [0..max]: controls the memory
requirements by the TNCES to token number of
memory, else the second adaptation probability is
chosen,
S : TN(•r) → TN(r•) : is the structure
modification instruction for reconfiguration scenario,
X : last state (•r) → initial state (r•) : is the state
processing function, where last state (•r)
(respectively, initial state (r•)) denotes the last
(respectively, initial) state of •r (respectively, r•)
before (respectively, after) the application of r.
A state machine specified by an TNCES, which
is called Structure_changer, is defined to describe
the control module. In this state machine, each place
corresponds to a specific TNCES of the GR-TNCES
model. Thus, each transition corresponds to a
reconfiguration function. The fact that a place sp
gets a token implies that the TNCES, to which sp
corresponds, is selected. If a transition st (∀st ∈ sp
• )
fires, then it removes the token away from sp and
brings it into a place sp’
with sp’ ∈ st•. Firing st
implies that a reconfiguration function is applied.
The Structure_changer is formalized as follows:
Structure_changer = (P, T, F, V, M
0
, P
0
)
Where ∀t ∈ T, |•t| = |t•| =1, ∑M
0
(P)=1, which means
state and only one TNCES is performed at any time.
The controller manages the GR-TNCES model using
the Structure_changer model. Each place of this
structure contains the whole information about the
corresponding TNCES e.g. its energy and memory
requirements (number of states in this TNCES).
Each state consumes one token from the energy and
memory reserve. So before enabling the
reconfiguration, tokens are removed from the
reserve. Only memory tokens are added to the
model’s memory at the end of the adaptation
process. Energy reserve will be removed from the
battery. Then, the battery will be charged
periodically.
3.2.2 Dynamics of GR-TNCES
The dynamic describes the behavior of this control
operation. Before moving the token from one place
to the next state, The structure modification
instruction S guides the GR-TNCES from TN(•r) to
TN(r•), including the condition/event signals among
them. The state processing function X maps the last
state of •r before the application of r to a feasible
initial state of r•, from which the reconfigured
system goes on running. The dynamics of an GR-
TNCES is represented in this section by referring to
self-modification nets and net rewriting systems. The
states of an GR-TNCES are defined as follows.
A state of G is a pair (TN(β), State(β)), where
TN(β) denotes the net structure of G and State(β)
denotes a state of G. The evolution of an GR-
TNCES depends on what events, energy and
memory constraints (reconfiguration functions or
transitions) take place. Using this GR-TNCES, a
reconfiguration function r = (Cond, P’, E’, M, S, X)
is enabled at state (TN(β), State(β)) if the new
original following conditions are met.
1) TN(β) = TN(•r), i.e., TN(β) is equal to the net
structure of •r and if the firing time
constraints are fulfilled,
2) Cond = true: its precondition is fulfilled,
3) E
0
> Cost TNCES (E
0
’): E
0
’ (token number)
is removed from the energy reserve,
4) M
0
> Cost TNCES (M
0
’), M
0
’ (token cost) is
removed from the memory controller. When
the reconfiguration is over, these memory
ICSOFT-EA2015-10thInternationalConferenceonSoftwareEngineeringandApplications
376