State aggregation is the composition of one state from several other independent states. The composition is of a conjunctive type (composition of type 'and'), which implies that the object must simultaneously be in all the states that constitute the aggregation. State aggregation corresponds to a kind of parallelism between state machines.
The following example illustrates different views of the concept of state aggregation. State
is an aggregation composed of two independent states S
and T
; U
is composed of substates T
, X
and Y
, and Z
is composed of substates U
and A
. The domain of B
is the Cartesian product of S
and T
.U
An input transition into state
implies the simultaneous activation of state machines S
and T
, i.e. the object is initially placed in the composite state U
. When event (Z,A)
occurs, the E3
and T
state machines can keep evolving independently, which brings the object to the composite state U
. State machines (X,A)
and T
may also evolve simultaneously, which is the case when event U
moves the object from composite state E1
to (X,A)
. Adding conditions to the transitions, such as the guard (Y,B)
placed on the transition from [in Z]
to B
, makes it possible to introduce dependency relationships between the components of the aggregate. When event A
occurs, the transition from E4
to B
is only valid if the object is also in state A
at that time.Z
State aggregation, together with state generalization, simplifies the representation of state machines. Generalization simplifies by factorization, and aggregation simplifies by segmentation of the state space. Without state aggregation, the state machine equivalent to the above would look like this:
At worst, the number of states of such a 'flat' state machine is equal to the product of the number of states of each component state machine. In the case of an aggregation of three state machines with a few hundred states each (which is already a lot), the equivalent flat state machine could contain up to a million states!
© 1997 Editions, Eyrolles, Paris, France . All rights reserved.