simulation of discrete event systems - startseite of discrete event systems ... the simulation of...

37
© Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University Simulation of Discrete Event Systems Univ.-Prof. Dr.-Ing. Dipl.-Wirt.-Ing. Christopher M. Schlick Chair and Institute of Industrial Engineering and Ergonomics RWTH Aachen University Bergdriesch 27 52062 Aachen phone: 0241 80 99 440 email: [email protected] Unit 1 Introduction to Discrete Event Systems Fall Winter 2013/2014

Upload: buihanh

Post on 24-Jun-2018

239 views

Category:

Documents


0 download

TRANSCRIPT

© Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Simulation of Discrete Event Systems

Univ.-Prof. Dr.-Ing. Dipl.-Wirt.-Ing. Christopher M. Schlick

Chair and Institute of Industrial Engineering and Ergonomics

RWTH Aachen University

Bergdriesch 27

52062 Aachen

phone: 0241 80 99 440

email: [email protected]

Unit 1

Introduction to Discrete Event Systems

Fall Winter 2013/2014

1 - 2 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Schedule of Lectures (L), Exercises (E), and

Examination

Unit Date Topics Instructor

1 (2L + 2E) 24.10.2013 Introduction to Discrete Event Systems Bützler, J.

2 (2L + 2E) 31.10.2013 Languages and Automata Brandl, C.

3 (2L + 2E) 07.11.2013 Statecharts Witt, O.

4 (2L + 2E) 14.11.2013 Petri Nets (I): Foundations of Net Models Kuz, S.

5 (2L + 2E) 21.11.2013 Petri Nets (II): Analysis of Net Models Kuz, S.

6 (2L + 2E) 28.11.2013 Timed Models Meyer, R.

7 (2L + 2E) 05.12.2013 Stochastic Timed Automata Faber, M.

8 (2L + 2E) 12.12.2013 Markov Chains Djaloeis, R.

9 (2L + 2E) 19.12.2013 Queueing Models Djaloeis, R.

10 (2L + 2E) 09.01.2014 Bayesian Networks Meyer, R.

11 (2L + 2E) 16.01.2014 Dynamic Bayesian Networks Bützler, J.

12 (2L + 2E) 23.01.2014 Variable Length Markov Chains Winkelholz, C.

13 (2L + 2E) 30.01.2014 Event Scheduling Scheme and Output Analysis Faber, M.

The written / oral exams take place in February 2013. For organizational questions regarding

the examination please feel free to contact our exams-team: mail: [email protected]

1 - 3 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Cassandras, C.,G.; Lafortune, S. (2008):

Introduction to Discrete Event Systems.

2nd edition

Boston (MA): Kluwer Academic Publishers

Textbook for Lectures and Exercises

© Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Simulation of Discrete Event Systems

Univ.-Prof. Dr.-Ing. Dipl.-Wirt.-Ing. Christopher M. Schlick

Chair and Institute of Industrial Engineering and Ergonomics

RWTH Aachen University

Bergdriesch 27

52062 Aachen

phone: 0241 80 99 440

email: [email protected]

Unit 1

Introduction to Discrete Event Systems

Fall Winter 2012/2013

1 - 5 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Simulation in Engineering Science

2. Definition of a Discrete Event System and Simple Modeling Examples

3. Levels of Abstraction in Model Development and Advanced Industrial Example

4. Generic Process Model of Simulation Studies

Contents

1 - 6 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Simulation in Engineering Science

1. Simulation in Engineering Science

1 - 7 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Today, the computer-aided simulation of man-made systems is one of the main

methodological approaches in engineering science, besides classic analytical methods

and empirical experiments in the lab or in the field.

According to the German standard VDI 3633 the term simulation refers to the imitation of a

real system with its dynamic processes in an experimentally exploitable and computationally

tractable model, which can be used to predict important aspects of the real behavior.

The simulation of dynamic systems has a tradition of more than 40 years in mechanical and

electrical engineering and therefore has a high level of accuracy and maturity.

Pictures:

Rechenzentrum

RWTH Aachen

The role of simulation in engineering science

1 - 8 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

model

dynamic static

Time-invariant Time-varying

nonlinear linear

discrete states continuous states

event-driven time-driven

stochastic deterministic

continuous-time discrete-time

Focus of lecture series

Basic classification scheme of simulation models

1 - 9 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

In continuous-state systems the state changes as time advances. This is particularly evident in

discrete-time models: The clock is the driving force for the sample path. With every clock tick the

state is expected to change, since continuous state variables continuously change with time.

Because of this property we refer to such systems as time-driven systems. The time variable t is a

natural independent variable appearing as the argument of all input, state and output functions.

In discrete-state systems the state changes only at certain points in time through instantaneous

transitions. An event can be associated with each transition. Let us assume there is an universal

clock through which we will measure time and consider the following possibilities:

1. At every clock tick an event e is to be selected from the event set E. If no event takes places, we use

a “null event” as a member of E, whose property is that it causes no state change.

2. At various time instants (not necessarily known in advance and also not necessarily coinciding with

clock ticks), some event e “announces” that it is occurring.

The fundamental difference between 1 and 2 is: In case 1, state transitions are synchronized by the

universal clock. There is a clock tick, an event is selected, the state changes, and the process

repeats. However, in case 2, every event e E defines a distinct process through which the time

instants when e occurs are determined. State transitions are the result of combining the

asynchronous and concurrent event processes. Moreover, these processes need not be

independent. Case 2 is characteristic for an event-driven system.

Time-driven versus event-driven systems

1 - 10 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Consider a random walking artificial entity (agent) on a plane in two dimensions. We can visualize this

walk as a particle, which can be moved one unit of a spatial distance (a step) at a time in one of four

directions: north, south, east, and west. The direction is chosen at random and is independent of the

present position. The state of the system is the absolute position (x1, x2) of the particle, measured on

the plane. The state variables denote the cartesian location taking only integer values and we have a

state space X = {(i, j): i, j = …,-1,0,1,…}. The event set is simply E = {N, S, W, E} corresponding to

the four discrete step events as above.

A possible sample path of this time-driven system starting with the initial state (0, 0) may look like this:

Example of time-driven discrete system:

A random walk

(t=1)

(t=2) (t=7)

(t=4) (t=6)

(t=9)

1 - 11 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

An alternative view of the previously described time-driven random walk comes from modifying the

rules controlling the movement of the particle. Suppose there are four different players, each one

responsible for moving the particle on the plane in a single direction: north (N), south (S), east (E),

or west (W). Each player acts by occasionally issuing a signal to move the particle in his direction.

These concurrent processes result in an event-driven system defined by these asynchronously

acting players.

As an example, suppose player N issues signals at discrete-time instants {7, 9}, S issues signals at

{2,10}, W issues signals at {4, 6}, and E issues signals at {1, 11}. The resulting sample path can be

visualized as a timing diagram, where the state transitions are event-driven. It is assumed that the

initial state is (0, 0):

Example of event-driven discrete system:

A different random walk

1 - 12 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

State-space with

no intrinsic order

(categorial)

Metric

state-space

Time-stamp of discrete events

Sequence of events (trace)

Comparison of observable behavior of time-driven

and event-driven systems

1 - 13 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

2. Definition of a Discrete Event System

and Modeling Examples

2. Definition of a Discrete Event System

and Modeling Examples

1 - 14 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Def.: A discrete event system (DES) is a system with discrete states si that are elements of a

finite state set X (si X, i = 1…|X|) and discrete events ej that are elements of a finitary

event set E (ej E, j = 1…|E|), which is event-driven and therefore the state evolution

depends entirely on the occurrence of asynchronous events over time.

In contrast to time-driven systems the state transitions of DES are not synchronized with the help of an

external clock. In other words, an element ej of the event set can represent a dynamic process of its

own right that is triggered, if the event ej occurs. The state transitions in an DES are effects of these

asynchronous and often concurrent processes. The phenomenon “time” in DES is no more longer than

the driving force (or order parameter) of system dynamics.

e1

e2

e3 . . .

Sample path of a queueing

system with queue length x(t)

Definition of a discrete event system

1 - 15 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Good

part (g)

Defective

part (d)

counter

Event set: E = {g, d, r}

Simple DES model of counter:

State transition diagram:

reset button (r) Functional sketch:

State set: X = {0, 1, 2, ..., n}

0 2 d

g

3 d

g

1 d

g

n d

g

. . .

r r

r r

g

Simple DES example: Counter (C) of defective parts

integrated in a measurement machine

belt conveyor

measurement machine

1 - 16 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Interactive demonstration of simulator software!!!

Implementation of the example counter with the help

of a computer-aided simulator (n = 5)

1 - 17 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Consider a state set X = {0, 1, 2, ..., 99} for the previously developed counter example.

How can the cardinality of the state set be reduced, if we can use a concurrent automata model

represented by two interacting state transition diagrams?

Lecture embedded exercise

1 - 18 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Least significant

digit

Event set:

E = {g, d, r, c}

State sets:

Xlsd={0, 1, 2,... 9 }

Xmsd ={0, 1, 2,... 9 }

Most significant

digit

0 2 d

g

3 d

g

1 d

g

9 d

g

. . .

r r

r

r

0 2 c

3 c

1 c

9 c

. . .

r r

r

r

Generate

carry

event c

C d

g

Solution: Two digit decimal counter with carry

1 - 19 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Interactive demonstration of simulator software!!!

Implementation of the two digit counter

1 - 20 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

3. Levels of Abstraction in Model Development

and Advanced Industrial Example

3. Levels of Abstraction in Model Development

and Application Example

1 - 21 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Logical Modeling of event sequences:

2. Modeling of time-stamped event sequences:

3. Modeling of time-stamped event sequences with stochastic dependencies:

(ej(1), ej(2), ..., ej(T)) (ej E)

((ej(1), t1), (ej(2), t2), ..., (ej(T), tT)) (ej E, t +)

P(X3 = ej(3) at t3 given that ej(2) at t2 and ej(1) at t1 occurred previously) P(X3 = ej(3) at t3)

Pro: Algebraic analysis and verification of system behavior possible

Contra: Often too abstract for detailed engineering phases in product development

Pro: High validity for completely digitized manufacturing systems

Contra: Often too deterministic for simulation of human factors and disturbance issues

Pro: Sufficient validity and reliability for modeling of socio-technical systems

Contra: Risk of false design decisions due to inaccurate parameter estimation

Levels of abstraction in model development

1 - 22 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Interactive demonstration of simulator software!!!

Appl. example for the 2nd level of abstraction:

Simulation of Flexible Manufacturing System

1 - 23 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

4. Generic Process Model of Simulation Studies

4. Generic Process Model of Simulation Studies

1 - 24 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Reference:

Banks 2000

Problem Formulation

Entwicklung

konzeptuelles

Modells

2

Development of

Computerized Model

Data

Collection

Model Integration

Verified?

Validated?

3 4

5

6

7

No

Yes

No No

Yes (continued on slide 26)

Development of Conceptual

Model

Flowchart of Generic Process Model (I)

1

1 - 25 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Insertion: Verification and validation of a DES

simulation model

(Quelle: Sargent 2003)

1 - 26 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Reference:

Banks 2000

Flowchart of Generic Process Model (II)

Experimental

Design

Production Runs

and Analysis

More Runs?

Documentation

and

Reporting

Model

Implementation

Yes Yes

8

9

10

11

12

1 - 27 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Initial empirical analysis of the problem domain together with the customer

2. Problem statement in terms of hypotheses and definition of dependent variables (cycle

time, resource consumption etc.)

3. Choice of level of detail to be modeled and simulated

4. Alignment of formulated hypotheses and modeling level of detail concerning the

expected results of the customer

5. Choice of conceptual modeling language (Petri nets, queueing models etc.) and data

modeling methods (class diagrams, data dictionary, lists etc.)

Generic process model – step 1: Problem formulation

1 - 28 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Detailed interactive analysis with the customer regarding the elements and relations of

the conceptual model to be simulated

2. Conceptual modeling of elements and relations with the help of the chosen conceptual

modeling language (graphical or textual)

3. Definition of system alternatives and therefore the independent variables in the

simulation study (alternative layouts of manufacturing systems etc.)

4. Choice of programming language and simulation software package to be used for

transforming the conceptual model into a computerized model

5. Specification of input requirements of the developed conceptual model

Generic process model – step 2:

Development of conceptual model

1 - 29 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Initial programming of small, simple model components and objects based on the

conceptual model, then step-by-step module accumulation and integration into main

model

2. Focusing on problem statement and hypotheses, not on “compilable” and “executable”

models

3. Coping with computational complexity: abstraction from real-life details; tests of runtime

behavior of critical components

4. Code reviewing with regard to reuse, reliability, and inline documentation of components

5. Integration of behavior and attributes into a consistent structure of objects

6. Quality control of final released modules by an independent expert

Generic process model – step 3:

Development of computational model

1 - 30 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Test of completeness and consistency of existing databases.

2. Collection of additionally required data with the help of objective and reliable methods

and techniques

3. Preprocessing and data integration into simulation database

4. Review of theoretical approaches to data generation such as mathematical process

and sensor models

Generic process model – step 4: Data collection

1 - 31 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Integration of simulation model code and data base, programming of “connectors”

and “wrappers”

2. Systematic management of changes in conceptual model, computerized model,

and data base due to code integration

3. Verification of computerized model with regard to the conceptual model

4. Successive refinement of validation levels:

- theoretical validation

- structural validation ( sensitivity analysis),

- replicated validation (comparison real data – simulation data)

Generic process model – step 5, 6, 7:

model integration, verification, and validation

1 - 32 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Choice of appropriate methods of inferential statistics (analysis of variance, linear

regression, cluster analysis etc.) to test the formulated hypotheses on the basis of the

dependent and independent variables

2. Critical review of the generated simulation data concerning required probability

distributions of dependent variables in inferential statistics

3. Estimation of number of replications to be computed for each system alternative in order

to fulfill the requirements of inferential statistics

4. Test of simulation model boundaries and comparison with simulated problem domain

boundaries

4. Unambiguous preparation and parameterization of system alternatives for production

runs

Generic process model – step 8:

Experimental design

1 - 33 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Calculation of production runs for the prepared system alternatives

2. Critical review of generated simulation data concerning the layers of validity

3. Measurement and optimization of simulation performance of developed computerized

model

4. If additional scenarios need to be simulated more production runs have to be carried out

5. Calculation of point and interval estimates of dependent variables given the levels of the

independent variables (conditional means, standard deviations etc.)

6. Computation of test statistic variables for inferential statistics and comparison with critical

values

Generic process model – step 9, 10:

Production runs and analysis

1 - 34 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

1. Consideration of reporting and documentation standards (conceptual model, dependent

variables etc.) for domain independent comparisons of system alternatives

2. Documentation of computation procedure in the production runs

3. Documentation of statistical test results and thorough interpretation of significant effects

3. Limitation of model and results according to the verified and validated variable ranges

4. Model and data maintenance for future improvements and adaptations

Generic process model – step 11:

documentation and reporting

1 - 35 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Focus of lectures

and exercices

Problem Formulation

Entwicklung

konzeptuelles

Modells

2

Development of

Computerized Model

Data

Collection

Model Integration

Verified?

Validated?

3 4

5

6

7

No

Yes

No No

Development of Conceptual

Model

Focus of lectures and exercices

1 - 36 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

• Cassandras, C.,G.; Lafortune, S. (1999): Introduction to Discrete Event Systems. Boston

(MA): Kluwer Academic Publishers.

• Banks, J.B. (Ed.) (1998): Handbook of Simulation. New York (NY):John Wiley & Sons.

References

1 - 37 © Chair and Institute of Industrial Engineering and Ergonomics, RWTH Aachen University

Open Questions ???

Questions ?