• No results found

SIMULATION CONCEPTS

In document Manufacturing Engineering Handbook (Page 183-186)

Charles Harrell

10.2 SIMULATION CONCEPTS

To gain a basic understanding of how simulation works, let’s look a little more in detail at a few of the key concepts involved in simulation. A simulation is defined using the modeling constructs pro-vided by the simulation software. When a model is run, the model definition is converted to a sequence of events that are processed in chronological order. As the simulation progresses, state and

Formulate a

FIGURE 10.2 The process of simulation experimen-tation.

statistical variables are updated to reflect what is happening in the model. To mimic the random behavior that occurs in manufacturing systems, random variates are generated from appropriate dis-tributions defined by the user. To ensure that the output results are statistically valid, an appropriate number of replications should be run.

10.2.1 Modeling Constructs

Every simulation package provides specific modeling constructs or elements that can be used to build a model. Typically, these elements consist of the following:

• Entities. The items being processed.

• Workstations. The places where operations are performed.

• Storages and queues. Places where entities accumulate until they are ready to be processed further.

• Resources. Personnel, forktrucks, etc. used to enable processing.

When defining a model using a manufacturing-oriented simulation package, a modeler specifies the processing sequence of entities through workstations and queues and what operation times are required for entities at each workstation. Once a model that accurately captures the processing logic of the system is built, it is ready to run.

10.2.2 Simulation Events

When a model is run, it translates the processing logic into the events that are to occur as time passes in the simulation. An event might be the arrival of a part, the completion of an operation, the failure of a machine, etc. Because a simulation runs by processing individual events as they occur over time, it is referred to as discrete-event simulation.

Simulation events are of two types: scheduled and conditional. A scheduled event is one whose time of occurrence can be determined beforehand and can therefore be scheduled in advance.

Assume, for example, that an operation has just begun and has a completion time that is normally distributed with a mean of 5 min and a standard deviation of 1.2 min. At the start of the operation a sample time is drawn from this distribution, say 4.2 min, and an activity completion event is scheduled for that time into the future. Scheduled events are inserted chronologically into an event calendar to await the time of their occurrence.

Conditional events are events that are triggered when some condition is met or when a com-mand is given. Their time of occurrence cannot be known in advance so they can’t be scheduled.

An example of a conditional event might be the capturing of a resource which is predicated on the resource being available. Another example would be an order waiting for all of the individ-ual items making up the order to be assembled. In these situations, the event time cannot be known beforehand so the pending event is simply placed on a waiting list until the condition can be satisfied.

Discrete-event simulation works by scheduling any known completion times in an event calendar in chronological order. These events are processed one at a time and, after each sched-uled event is processed, any conditional events that are now satisfied are processed. Events, whether scheduled or conditional, are processed by executing certain logic associated with that event. For example, when a resource completes a task, the state and statistical variables for the resource are updated, the graphical animation is updated, and the input waiting list for the resource is examined to see what activity to respond to next. Any new events resulting from the processing of the current event are inserted into either the event calendar or other appropriate waiting list. A logic diagram depicting what goes on when a simulation is run is shown in Fig. 10.3.

10.2.3 State and Statistical Variables

State variables represent the current condition or status of a model element at any given point in time in the simulation. A state variable might be the number of items in a queue, or whether a machine is busy or idle. State variables in discrete-event simulation change only when some event occurs. Each time a state variable changes, the state of the model is changed since the model state is essentially the collective value of all the state variables in the model. (See Fig. 10.4).

During a simulation, statistics are gathered using statistical variables on how long model ele-ments were in given states and how many different types of events occurred. These statistical vari-ables are then used to report on the model performance at the end of the simulation. Typical output statistics include resource utilization, queue lengths, throughput, flow times, etc.

Advance clock to next event time

Termination event?

Update statistics, state variables, and animation

Process event &

Schedule any new event s

Any conditional events?

Yes

No Create simulation data base & Sche-dule initial events

Update statistics and Generate output report Yes

No

Stop Start

FIGURE 10.3 Logic diagram of how discrete-event simulation works.

10.2.4 Generating Random Variates

Nearly all types of manufacturing systems that are modeled have random behavior such as the time to complete an operation, or the time before the next machine failure. Discrete-event simulation employs statistical methods for generating random behavior. These methods are sometimes referred to as Monte Carlo methods because of their similarity to the probabilistic outcomes found in games of chance, and because Monte Carlo, a tourist resort in Monaco, was such a popular center for gambling.

Random events are defined by specifying the probability distribution from which the events are generated. During the simulation, a sample value (called a random variate) is drawn from the prob-ability distribution to use to schedule this random event. For example, if an operation time varies between 2.2 and 4.5 min, it would be defined in the model as a probability distribution. Probability distributions are defined by specifying the type of distribution (normal, exponential, etc.) and spec-ifying values for the defining parameters of the distribution. For example, we might describe the time for a check-in operation to be normally distributed with a mean of 5.2 min and a standard deviation of 1 min. During the simulation random variates are generated from this distribution for successive operation times.

10.2.5 Replications

When running a simulation with one or more random variables, it is important to realize that the out-put results represent only one statistical sample of what could have happened. Like any experiment involving variability, multiple replications should be run in order to get an expected result. Usually any-where from five to thirty replications (i.e., independent runs) of the simulation are made depending on the degree of confidence one wants to have in the results. Nearly all simulation software provides a replication facility for automatically running multiple replications, each with a different random num-ber sequence. This ensures that each replication provides an independent observation of model perfor-mance. Averages and variances across the replications are automatically calculated to provide statistical estimates of model performance. Confidence intervals are also provided that indicate the range within which the true performance mean is likely to fall.

In document Manufacturing Engineering Handbook (Page 183-186)