modeling examples types of model conceptual containing components that have not been clearly...

41
MODELING EXAMPLES f model ual ntaining components that have not been clearly ied in terms of theoretic categories such as stat nd function it only emphasizes objects and their nship to one another

Upload: ashlee-peters

Post on 17-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MODELING EXAMPLES

Types of model

Conceptual

Containing components that have not been clearly

Identified in terms of theoretic categories such as state,

event and function it only emphasizes objects and their

relationship to one another

Page 2: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MODELING EXAMPLES

Declarative

Declaration models deemphasize the actual functions

that causes state change. Contains two components states

and events. We can take any action and break it into

sub actions. Refer to past notes.

Page 3: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MODELING EXAMPLES

Functional

Focuses on functions that transform input into output

while keeping track of state vector along the way. The two

approaches of functional modeling are identified by

function-based or variable- based.

Page 4: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Functional continue…

When to used:

1. If problem is given in term of distinct physical objects which are connected in a direct order, use a functional model.

(i) if objects are primarily functional in nature use functional-based approach

(ii) if objects represent capacitance or storage use

variable-based approach

2. If the problem involves material flow throughout the

system.

MODELING EXAMPLES

Page 5: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

3.Y2.Y1.Y

Examples

Lines

Customer

Server Conceptual model

MODELING EXAMPLES

Time

Customer

Server transfer function

Customer

Time

3.Y2.Y1.Y

Functional model

Page 6: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MECHANISMS FOR TIME ADVANCE

One of the central functions of a simulation system

described earlier is the simulation executive. The executive

manages the passage of time and ‘steps’ the model into

the future, executing the relevant logical relationships along

the way.

There are two basic approaches for controlling the time

advance:

•Time slicing

•Next event

Page 7: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MECHANISMS FOR TIME ADVANCE

Time Slicing

With the time slicing approach advances the model

forward in time at fixed intervals, e.g. every 5 seconds.

The executive moves the model between the time intervals

regardless of whether anything will happen.

Page 8: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MECHANISMS FOR TIME ADVANCE

Next Event

With next event the model is advanced to the time of the

next significant event. Hence if nothing is going to happen

for the next 3 minutes the executive will move the model

forward 3 minutes in one go. The nature of the jumping

between significant points in time means that in most cases

the next event mechanism is more efficient and allows models

to be evaluated more quickly.

Page 9: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Simulation software have graphical displays to

show the user the changing status of machines (running,

idle, etc.) and the movement of parts. Because the software

jumps between significant points in time the jumps may be

uneven with many jumps separated only by 5 seconds of

simulated time followed by one or two jumps of 4 minutes say.

The series of snap shots shown by the graphical displays

can be misleading and machines may appear broken down

for long periods of time when in fact this is not the case.

Next Event disadvantages

Page 10: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Concepts in Discrete-Event Simulation

Terms and explanation

System :

A collection of entities (e.g. people and machines) that interact

together overtime to accomplish one or more goals.

Page 11: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Model :

An Abstract representation of a system, usually

containing

Structural, logical, or mathematical relationships

which

describe a system in terms of state, entities and

their attributes, sets, processes, events, activities,

and delays.

Concepts in Discrete-Event Simulation

Terms and explanation

Page 12: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Concepts in Discrete-Event Simulation

Terms and explanation

System state:

A collection of variables that contain all the information

Necessary to describe the system at any time.

Entity :

Any object or component in the system which requires explicit

representation in the model (e.e. a server, a customer,

a machine ).

Page 13: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Concepts in Discrete-Event Simulation

Terms and explanation

Attributes :

The properties of a given entity (e.g. the priority of waiting

customer, the routing of a job through a job shop).

List :

A collection of (permanently or temporarily) associated entities,

ordered in some logical fashion (such as all customers currently

in waiting line, ordered by first come first serve or by priority)

Page 14: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Concepts in Discrete-Event Simulation

Terms and explanation

Events :

An instantaneous occurrence that changes the state of

a system (such as an arrival of a new customer).

Event notice :

A record of an event to occur at the current or some

future time, along with any associated data necessary

to execute the event; at a minimum, the record

includes event type and time.

Page 15: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Concepts in Discrete-Event Simulation

Terms and explanation

Event list :

A list of event notices for future events, ordered by

time of occurrences; also known as the future event

list (FEL)

Activity :

A duration of time specified length (e.g. a service

time or inter-arrival time), which is known when it

begins(although it may be defined in terms of a

statistical distribution.

Page 16: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Concepts in Discrete-Event Simulation

Terms and explanation

Delay :

A duration of time of unspecified indefinite length,

which is not known until it ends ( e.g. a customer’s

delay in a last-in, first-out waiting line which, when it

begins, depends on future arrivals).

Clock:

A variable representing simulated time called CLOCK

in the examples to follow.

Page 17: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MECHANISMS FOR DESCRIBING LOGIC

There are a number of different ways of representing

the logic within a discrete event simulation model.

These approaches can be used for modeling the same

systems and will (should!) result in the same results, the

differences lie in the ease by which they can be understood

and implemented and the efficiency of their computation.

Three mechanisms will be briefly described followed by

detailed explanation of one of them

Page 18: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

MECHANISMS FOR DESCRIBING LOGIC

The approaches are illustrated in Figure 3 are :

•Event

•Activity

•Process

Figure 3. Ways of describing model logic

Page 19: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The event approach describes an event as an

instantaneous change and such events are usually paired,

e.g. start of machine loading, end of machine loading, etc.

Activities describe a duration, e.g. machine loading, and

are therefore very similar to pairs of events. The process

approach joins collections of events or activities together

to describe the life cycle of an entity, in this case a machine.

MECHANISMS FOR DESCRIBING LOGIC

Page 20: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The event approach is easy to understand and

computationally efficient but is more difficult to implement

than the activity approach. On the other hand whilst

activity approach is relatively easy to understand it suffers

from poor execution efficiency. The process is less common

and requires more planning to implement properly though

is generally thought to be efficient.

MECHANISMS FOR DESCRIBING LOGIC

Page 21: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Detail of the event execution structure

The event approach is described in Figure 4. The diagram

shows two essential elements: the clock and simulation

executive. Here the simulation executive will use an ‘event

list’ (a string of chronologically ordered events).

Page 22: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Figure 4. Detail of the event approach structure (from Kreutzer, 1986)

Page 23: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The executive is responsible for ordering the events.

The executive removes the first event from the list and

executes the relevant model logic. Any new events that

occur as a result are inserted on the list at the appropriate

point (e.g. a machine start load event would generate a

machine end load event scheduled for several seconds time).

The cycle is then repeated.

Detail of the event execution structure

Page 24: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Each event on the event list has two key data items. The

first item is the time of the event which allows it to be

ordered on the event list. The second item is the reference

to the model logic that needs to be executed. This allows

the executive to execute the correct logic at the correct time.

Note that more than one event may reference the same

model logic, this means that the same logic is used many

times during the life of the simulation run.

Detail of the event execution structure

Page 25: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Example of the mechanism working .

Figure 5 illustrates the next event mechanism. The rows

show the advance of time for a simple model involving

one machine (cycle time 5) feeding a buffer followed by

another machine (cycle time 12) that removes parts from

the buffer to process them. Parts arrive every 6. The units

of time could be seconds, minutes, hours, etc. depending

on the model

Page 26: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Figure 5. Passage of time in next event simulation

Page 27: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The model starts from the common starting point know as

‘empty and idle’; the all entities are idle and there are no

parts in the system.

The next most significant time is 6 when the first part arrives.

The executive jumps straight to this time. When the first part

arrives the first machine starts processing it.

Example of the mechanism working .

Page 28: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

At time 11 (5 later) the executive will cause the first

machine to place its processed part in the buffer. Immediately

the second machine takes the part and starts processing it.

Note that events may occur at the same time, as well as

there being significant times between events.

The model unfolds over time with parts arriving, being

processed on machine1 and placed in the buffer. As would

be expected parts accumulate in the buffer since machine2

is slower.

Detail of the event execution structure

Page 29: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

For a graphical display the machines would be shown

as icons changing color when running. According to a

graphical display it would appear that machine2 is busier

than machine one. If the figures for the busy time are added

up for each machine (machine1 : 16 -vs.- machine2 : 13)

it is apparent that machine1 was busier. This is one of

problems noted before that can occur when the graphical

displays of next event simulation are taken too literally.

Example of the mechanism working.

Page 30: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

A simple intro to execution of simulation.

A small grocery store has only one checkout counter.

Customer arrive at this checkout counter at random from 1-8

minutes apart. Each possible value of inter-arrival time has

the same probability of occurrence, as shown in Table 2.1

The service time vary from 1 to 6 minutes with probabilities

shown in Table 2.0. The problem is to analyze the arrival and

service of 20 customer.

Page 31: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

Arrival queue server

Service node

Departure

Figure 6.0 Grocery shop service node diagram

Page 32: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

Event of single-channel queue consist of two events

(i) unit-arrival event

(ii) unit-complete event

Arrival Event

Server Busy ?

Unit entersservice

Unit entersQueue for service

Page 33: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

DepartureEvent

Another Unit waiting ?

Begin serveridle time

Remove the waitingunit from the queue

Begin servicingthe unit

YesNo

Page 34: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

Service Service Time Time

(minutes)(minutes)

ProbabilitProbabilityy

CumulativCumulative e

ProbabilitProbabilityy

Random-Random-Digit Digit

AssignmeAssignmentnt

11 0.100.10 0.100.10 01-1001-10

22 0.200.20 0.300.30 11-3011-30

33 0.300.30 0.600.60 31-6031-60

44 0.250.25 0.850.85 61-8561-85

55 0.100.10 0.950.95 86-9586-95

66 0.050.05 1.001.00 96-0096-00

Table 2.0 Service Time Distribution

Page 35: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

Time Time between between Arrivals Arrivals

(minutes)(minutes)

ProbabilitProbabilityy

CumulativCumulative e

ProbabilitProbabilityy

Random-Random-Digit Digit

AssignmeAssignmentnt

11 0.1250.125 0.1250.125 001-125001-125

22 0.1250.125 0.2500.250 126-250126-250

33 0.1250.125 0.3750.375 251-375251-375

44 0.1250.125 0.5000.500 376-500376-500

55 0.1250.125 0.6250.625 501-625501-625

66 0.1250.125 0.7500.750 626-750626-750

77 0.1250.125 0.8750.875 751-875751-875

88 0.1250.125 1.0001.000 876-000876-000

Table 2.1 Distribution of time between Arrival

Page 36: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

CustomeCustomerr

Random Random digitsdigits

Time Time between between arrivals arrivals

(minutes(minutes))

CustomeCustomerr

Random Random digitsdigits

Time Time between between arrivals arrivals

(minutes(minutes))

11 -- -- 1111 109109 11

22 913913 88 1212 093093 11

33 727727 66 1313 607607 55

44 015015 11 1414 738738 66

55 948948 88 1515 359359 33

66 309309 33 1616 888888 88

77 922922 88 1717 106106 11

88 753753 77 1818 212212 22

99 235235 22 1919 493493 44

1010 302302 33 2020 535535 55

Table 2.3 Time-Between-Arrivals Determination

Page 37: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

The Grocery Shop Problem

CustomeCustomerr

Random Random digitsdigits

Service Service time time

(minutes(minutes))

CustomeCustomerr

Random Random digitsdigits

Service Service Time Time

(minutes(minutes))

11 8484 44 1111 3232 33

22 1010 11 1212 9494 55

33 7474 44 1313 7979 44

44 5353 33 1414 0505 11

55 1717 22 1515 7979 55

66 7979 44 1616 8484 44

77 9191 55 1717 5252 33

88 6767 44 1818 5555 33

99 8989 55 1919 3030 22

1010 3838 33 2020 5050 33

Table 2.4 Services time generated

Page 38: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Findings from Grocery Shop Simulation Table

1. Average waiting time ( minutes )

=total time customer wait in queue (minutes) total numbers of customers

=56

20= 2.8

2. Probability (wait)

= Number of customers who wait total numbers of customers

=13

20= 0.65

Page 39: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Findings from Grocery Shop Simulation Table

3. Probability of idle server

=total idle time of server (minutes) total run time of simulation

=18

86= 0.21

4. Average service time (minutes)

= Total service time (minutes) total numbers of customers

=68

20= 3.4

minutes

Page 40: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Findings from Grocery Shop Simulation Table

5. Expected Service time ( minutes )

E(s) =∞ Σ sp(s) S=0

= 1(0.10)+2(0.20)+3(0.30)+4(0.25)+5(0.10)+6(0.05)

= 3.2 minutes

6. Average time between arrivals (minutes)

=

Sum of all times between arrival (minutes) Number of arrivals - 1

=82

19= 4.3

minutes

Page 41: MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,

Findings from Grocery Shop Simulation Table

7. Average waiting time of those who wait ( minutes )

=total time customer wait in queue (minutes) total numbers of customers who wait

=56

13= 4.3

8. Average time customer spends in the system

=

total time customer spend in system (minutes) total numbers of customers

=124

20= 6.2