## Multi-Step Activities in EZStrobe - 1

Identical and Consecutive Steps

Certain repetitive work, such as loading a flatbed truck with five
prefabricated beams using a crane, can also be viewed as one multi-step activity that consists of *n*
identical steps. A multi-step activity thus offers a choice between modeling all the
work as (a) one long activity, or (b) as *n* consecutive shorter activities. For
example, loading a flatbed can be modeled as one activity that represents
loading all five beams, or as five consecutive activities each of which
represents loading one beam.

The most straightforward way to represent a multi-step activity in an EZStrobe
ACD is to model it as just **one** Activity and give it a duration
that represents the time it takes to perform **all**
*n*
steps.

This approach is possible if all the resources required by a multi-step
activity remain committed to the activity during all *n* steps. The commitment
of resources to multi-step activities is illustrated in the EZStrobe network
below (click it to see in detail).

There are two multi-step activities in this model: One for loading five
beams at the fabrication site (*LoadTrk*) and another for unloading them at the job site
(*UnloadTrk*). Notice that when combi activity *LoadTrk*
starts, it captures the *Loader* (for example, a crane) and does not
release it until it is done. This means that the crane (*Loader*) starts loading a
flatbed **only** when five beams are
available and it never stops to do something else until all five beams are
loaded.

There are at least three possible
approaches for specifying the durations *LoadTm* and *UnloadTm*
for the multi-step activities *LoadTrk* and *UnloadTrk* in the
above network.

##### A. The distribution of the time required to complete **all** *n* steps
is available.

Suppose that the time it takes to load
**all** five beams is known to follow the distribution *
ScaledBeta*[5,10,8,8]
(minutes). In this case, the duration of *LoadTrk* can be specified
by an EZStrobe **Result**
called *LoadTm* which is defined with the formula 'ScaledBeta[5,10,8,8]'.

Notice that it is often convenient to model the duration of an
activity, such as
*LoadTrk,* indirectly using an EZStrobe **Result**. An EZStrobe **Result** is like a
dynamic Excel
formula that is reevaluated every time a new activity instance needs to
sample its own duration. Thus, every instance of *LoadTrk* will have
a different duration.

Important: The duration of an Activity
should **never** be defined by an EZStrobe **Parameter.**
An EZStrobe **Parameter** is just a
constant whose value could be initialized by a formula (if so desired). EZStrobe will evaluate the
formula for a **Parameter** only **once**, at the start of the simulation,
and will store this result as the fixed value of the
**Parameter** from then on. Hence, using an EZStrobe **Parameter**
is a mistake because it makes all
instances of an activity have the exact same duration and zero variability.

##### B. The distribution for the duration of each step is available and the
number of steps that make up the multi-step activity is relatively small.

For example, the time it takes to unload one beam folows the
distribution *Uniform[1,2]*
(minutes) and it takes unloading five beams to complete the activity.

In this case, the duration of the entire activity is most easily specified by an EZStrobe **Result**
that is defined as the explicit sum of *n* samples from the distribution of the time
for each step.

For example, the duration of *
activity UnloadTrk* can be specified by the **Result** *
UnloadTm * defined
by the formula:

*
Uniform[1,2]+Uniform[1,2]+Uniform[1,2]+Uniform[1,2]+Uniform[1,2]*.

If
the number of steps is large, then it becomes cumbersome to define the
formula for the
**Result**, even with cut-and-paste, although EZStrobe will actually allow the formula for
a
**Result** to be up to 64k characters in length.

Important: Note that the sum of 5 independent samples from *Uniform[1,2]*
follows an
Irwin-Hall distribution
with parameter 5, that is scaled and translated to the range [5,10]. This
distribution can be approximated well by a Beta distribution (with both
shape parameters set to 8), or a Normal distribution (with mean 7.5 and
variance 5/12, see below). These three distributions are very close to each
other and they are all bell-shaped.

A common **mistake** is to define *
UnloadTm* using the formula *5*Uniform[1,2]*, thinking that it is
the same as above sum. **That is not so**. This last formula
just multiplies one
sample from *Uniform[1,2] *by 5. Clearly, the resulting duration
follows a uniform distribution from 5 to 10. This distribution is flat and
not bell-shaped, and although its mean is 7.5, its variance is 25/12 (much
greater than 5/12).

##### C. The distribution for the duration of each step is available and the
Central Limit Theorem applies.

When the number of steps in a multi-step activity is
sufficiently large, it may be possible to invoke the Central Limit Theorem and
approximate the total duration of a multi-step activity by a Normally distributed
variate. One well-known necessary condition for the Central Limit Theorem is that the number of
random variables being summed up is large enough. It is interesting to note
that having just five
uniformly-distributed steps is indeed enough for the sum of their durations to
follow approximately a Normal distribution.

The duration *X* of each step with distribution *Uniform[1,2]*
has mean = 1.5 and variance 1/12, hence the sum, *T,* of 5 such IID
variates, *T=X1+X2+X3+X4+X5*, has mean 7.5 and variance 5/12. Thus,
the duration of *
activity UnloadTm* can be specified approximately by a **Result** defined
by the formula:

*
Normal[7.5,Sqrt[5/12]]*

This discussion continues with
Multi-Step Activities in EZStrobe
- 2, Non Identical Consecutive Steps
which describes how to model multi-step activities when

- The durations of the required steps are
**not**
Independent and Identically Distributed (IID), or
- The number of steps
required is variable, or
- The multi-step activity can be interrupted
between steps.

The EZStrobe model for the above example can be obtained
here. It has a seed and uses multiple random number streams so that it
yields the exact same output as other models that are supposed to be
identical.