Sunteți pe pagina 1din 30

University "Politehnica" of Bucharest

Faculty of Engineering in Foreign Languages


Master Studies in Business Administration and Engineering

Event Driven
Dynamic Systems

Bujor PĂVĂLOIU

2018
 Dynamic Systems
 Discrete Event Examples
 Untimed DES

Event Driven Dynamic Systems 2


Dynamic Systems
 Try some definitions of
 System
 Dynamic

 Dynamic System

Even if Dynamic can have the meaning of


Powerful or Active, a Dynamic System is
a primarily a Changeable System.

Event Driven Dynamic Systems 3


Event Driven Systems
 An Event is a “thing in time”

 Typing “Event Driven” in a search


engine

 Event Driven Programming


 Event Driven Architecture/ Business

Event Driven Dynamic Systems 4


Event Driven Programming

 Event-Driven Programming (EDP) is


a programming paradigm in which
the flow of the program is
determined by events
 sensor outputs
 user actions (mouse clicks, key presses)

 messages from other programs or


threads

Event Driven Dynamic Systems 5


Event-driven programming
It uses an Infinite Loop with
 Event detection

 Event dispacher

The event dispatcher calls the event


handlers, often using an event queue
to hold unprocessed events.

 Different from Batch Programming (BP)


Event Driven Dynamic Systems 6
EDP versus BP
 In Bach Programming, the flow of
the program is determined by the
programmer
 Give two short examples of
pseudocode of the same problem
treated using EDP and BP.
 What are the differences?
 What’s the main advantage of EDP?

Event Driven Dynamic Systems 7


Event-driven architecture
 In an event-driven architecture, a notable
thing happens inside or outside your
business, which disseminates immediately to
all interested parties (human or automated).
The interested parties evaluate the event,
and optionally take action. The event-driven
action may include the invocation of a
service, the triggering of a business process,
and/or further information publication/
syndication.

Event Driven Dynamic Systems 8


Properties
 Extreme Loose Coupling. By its nature, an
event-driven architecture is extremely
loosely coupled, and highly distributed. The
creator (source) of the event only knows the
event transpired. The creator has no
knowledge of the event’s subsequent
processing, or the interested parties. The
traceability of an event through a dynamic
multipath event network can be difficult.
Thus, event-driven architectures are best
used for asynchronous flows of work and
information.
Event Driven Dynamic Systems 9
DES
 The acronym DES, or frequently
DEDS (for discrete event dynamic
systems), has been used extensively
in many different fields of
mathematics and applications, to
designate apparently widely different
systems. Nevertheless, all these
systems have in common the
property of being driven by events,
rather than by time.
Event Driven Dynamic Systems 10
DES
 A Discrete Event System (DES) can
be defined as a dynamic system for
which the state changes in response
to the occurrence of discrete events.
The discrete events take place at
possible irregular or unknown time
instants, i.e., asynchronously and
non-deterministically, but are the
result of interactions within the
system itself.
Event Driven Dynamic Systems 11
DES
 The conceptual structure of a DES is
deceptively simple: A system composed of
multitudes of “jobs” that require various
services from a multitude of "resources.”
The limited availability of the resources
determines the interactions between the
jobs, while the start and the completion of
the jobs, as well as the changes of the
resources generate the events that govern
the dynamics of the system.

Event Driven Dynamic Systems 12


This conceptually simple model
encompasses scores of event-driven,
mostly man-made, overwhelmingly
complex systems:
 large international airports,
 automated manufacturing plants,
 military logistic systems,
 emergency hospital wards,
 offices,
 services and spare parts operations of
multinational companies,
 distributed computing systems,
 large communication and data networks

Event Driven Dynamic Systems 13


DES
DES approaches

 State Machines
 Formal Languages Models

 Petri Nets

 Timed Marked Graphs

 Markov Processes

 …

Event Driven Dynamic Systems 14


 We will focus on the modeling of
DESs, which allows one to grasp the
basic features and the behavior of
DESs.
 Some elements of the control of
DESs will be presented,
 We will provide examples of DES
applications.

Event Driven Dynamic Systems 15


CVDS versus DEDS
Continuous Variable Dynamic System Discrete Event Dynamic System

x(t) CVDS DEDS qn-1


Input = u(t)
d
s n -1 = a sn=g
x&(t) = f(x, u, t)

State (set of states)


State (state variable)

q2 qn
b
s2 = b s3= g
q1 q3
a
s1= a
q0
s
t t1 t2 t3 t n -1 tn
Time (time variable) Time (event sequence)

(a) (b)

(a) Example of an illustrative one-dimensional CVDS trajectory, (b) Example of a DES trajectory ( a , b , g ,   ,a,b,c,d,s  Q

Event Driven Dynamic Systems 16


DES
 Untimed (Logical)
 Timed DES

Untimed or Logical DES models ignore


the time as a variable that specifies
the moments when the events occur.
Only the order of the events is
relevant for these models.

Event Driven Dynamic Systems 17


Untimed DES
 Used for the deterministic qualitative
analysis of control
 reachability of states
 deadlock avoidance

 Tools to study Untimed DES


 Finite State Machines
 Petri Nets

Event Driven Dynamic Systems 18


Untimed DES
 The simplest untimed DES model is a
deterministic state-machine or automaton,
called generator, described by the 4-tuple

G = (Q, Σ, δ, s)

 where Q is the (countable) set of states of


the system, Σ is the (countable) set of
events, δ: QxΣ→QU{Λ} is the transition
function, and s = q0 is the initial (start)
state of the system.

Event Driven Dynamic Systems 19


 The function δ describes the transition
from a state q in Q to a new state q’=
δ(q, σ), in response to the occurrence
of an event σ in Σ.
 The symbol Λ denotes the null
element which is used to indicate that
the transition is not defined for some
pairs (q, σ) in QxΣ.
 For this reason δ is called a partial
function

Event Driven Dynamic Systems 20


 We denote by Σf(q) the set of all
feasible events for a given state q,
i.e. Σf(q)={σ in Σ | δ(q, σ) ≠ Λ}.

 We denote by Σ* the set of all finite


strings of elements of S, including
the empty string ε.

Event Driven Dynamic Systems 21


 A sample path (trajectory) of a DES,
starting from the specified initial state
q0=s is given by the state-(event-
state) sequence
q0σ1q1σ2… σnqn
The set of all (physically) possible such
sequences is called the behavior B(G)
of the generator G
B(G)={q0σ1q1σ2…qnσn | n in N*, 1≤k≤N,qk=δ(qk-1, σk)}

Event Driven Dynamic Systems 22


The transition graph of a
simple generic machine model

The system can be in the I


states in:
I — Idle S
R
W — Working C
D—Down
The transitions are induced by W B D
the events in:
S — Start of a task
C — Completion of the task
B — Breaking down
R — Repair
Event Driven Dynamic Systems 23
 Q={I,W,D}
 Σ= {S,C,B,R}

 The initial state s = I is marked with


an entering arrow

 The language generated by G is:

L(G)={ε,S,SB,SC,SCS,SCSB,SBR,SBRS,...}

Event Driven Dynamic Systems 24


In the formalism of regular expressions:

L(G)=(SC+SBR)*(ε+S+SB)

Event Driven Dynamic Systems 25


 Let us now consider the case of two
machines of the type given in the
previous example working in parallel.
Each machine has a generator of the
previously considered type.

 Q1={I1,W1,D1}
 Q2={I2,W2,D2}

 Σ1= {S1,C1,B1,R1}
 Σ2= {S2,C2,B2,R2}

Event Driven Dynamic Systems 26


The transition graphs of two machines
working as independent entities

I1 I2

S1 S2
C1 C2

R1 R2
W1 W2

B1 B2

D1 D2

Event Driven Dynamic Systems 27


 The system composed of the two such
machines working in parallel, even
without conditioning each other,
has the state set:
 Q=Q1×Q1={(I1,I2), (I1,W2), (I1,D2),
(W1,I2), … , (D1,D2) }

and the events set:


 Σ=Σ1U Σ2= {S1,C1,B1,R1,S2,C2,B2,R2}

Event Driven Dynamic Systems 28


The transition graph of a system
composed of two machines
I2 W2 D2
R2

S1
B2
I1

C2
C1 C1
C1
S1 S1 S1
R2

S1
B2
W1
C2
R1 R1 R1
B1 B1 B1

R2

S1
B2
D1

C2

Event Driven Dynamic Systems 29


Observations
 The complexity of DES increases
combinatorial with the number of
elements
 Since Untimed Models contain no
quantitative timing information, they
can not be used to obtain
performance measures involving
time, such as holding times or event
occurrence rates.

Event Driven Dynamic Systems 30

S-ar putea să vă placă și