aci surepath - imag

48
Aci SurePath Perfect simulation of finite capacity queueing networks J-M. Vincent and B. Tanzi Decore-Imag and Apache-Inria Projects ID-IMAG Laboratory Universities of Grenoble http://www-id.imag.fr [email protected]ACI SurePath – Paris – 14/10/04 1

Upload: others

Post on 02-Jan-2022

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Aci SurePath - imag

Aci SurePath

Perfect simulation of finite capacity queueing

networks

J-M. Vincent and B. Tanzi

Decore-Imag and Apache-Inria ProjectsID-IMAG Laboratory

Universities of Grenoble

http://www-id.imag.fr

[email protected] – ACI SurePath – Paris – 14/10/04 – 1

Page 2: Aci SurePath - imag

Outline

1. Motivations, simulation of Markov chains andavailability

2. Markovian queueing networks

3. Perfect simulation

4. Events and monotonicity

5. PSI2 architecture

6. Examples and demo

7. Conclusion and future works

[email protected] – ACI SurePath – Paris – 14/10/04 – 2

Page 3: Aci SurePath - imag

Modeling discrete event systems

SYSTEM

STATE+

TRANSITIONS

Markov model

ALGEBRAIC

RESOLUTION

piQ=0

COST

DISTRIBUTION

Cost(pi)

Difficulties:- complex structure synchronizations- rare event probability estimation- analytical/numerical method- approximation/bounding techniques

⇒ reduction of the state space

[email protected] – ACI SurePath – Paris – 14/10/04 – 3

Page 4: Aci SurePath - imag

Modeling discrete event systems

SYSTEM

STATE+

TRANSITIONS

Markov model

DIRECT STATE

SIMULATION

state x

COST

COMPUTATION

Cost(x)

Difficulties:- stopping criteria : burn in time- simulation biases ||πn − π∞||

- estimation biases : confidence intervals O( 1√n)

[email protected] – ACI SurePath – Paris – 14/10/04 – 4

Page 5: Aci SurePath - imag

Modeling discrete event systems

SYSTEM

STATE+

TRANSITIONS

Markov model

BACKWARD COST

SIMULATION

cost c

Properties:- Exact stopping criteria

⇒ no simulation biasConstraints:- N parallel trajectories

[email protected] – ACI SurePath – Paris – 14/10/04 – 5

Page 6: Aci SurePath - imag

Queueing systems models

Model of resource contention

Properties:- Finite capacity queues- Routing policies- Blocking schemes

⇒ estimation of losses and saturation⇒ rare events, availability

[email protected] – ACI SurePath – Paris – 14/10/04 – 6

Page 7: Aci SurePath - imag

Basic queue

Basic model of resource contention :time (server) and memory (capacity)

Markovian queues :- arrival Poisson process λ : +1 transition- exponential service time µ : -1 transition- Birth and Death process

⇒ monotonous [email protected] – ACI SurePath – Paris – 14/10/04 – 7

Page 8: Aci SurePath - imag

Basic queue : transition function

State space = {0, 1, · · · , C}Two types of events :

Φ(x, arrival) = min(x + 1, C)

Φ(x, departure) = max(x− 1, 0)

Monotonicity according to events :

x 6 y ⇒ Φ(x, event) 6 Φ(y, event)

Remark : link with the st-monotonicity

[email protected] – ACI SurePath – Paris – 14/10/04 – 8

Page 9: Aci SurePath - imag

Network of queues : transition function

Queueing network- K queues, capacity Ci for queue i- State spaceX = {0, · · · , C1} × · · · × {0, · · · , CK}Events : e1, · · · , em

Φ(x, event) = next state

[email protected] – ACI SurePath – Paris – 14/10/04 – 9

Page 10: Aci SurePath - imag

Iterated system of functions

X state space (size n); U set of external input valuesTransition function Φ

Φ : X × U −→ X(x, u) 7−→ Φ(x, u)

If {Un}n∈Zis IID then

X0 = x0, Xn+1 = Φ(Xn, Un+1)

is a Markov chain (stochastic recursive sequence).

{Φ(., u)}u∈[0,1[

is an iterated system of function.Reciprocally, given a transition matrix Q it is possible to build a family of function Φ(., u)

such that the associated process is a markov chain with transition matrix Q.=⇒ Simulation kernel

[email protected] – ACI SurePath – Paris – 14/10/04 – 10

Page 11: Aci SurePath - imag

Backward coupling simulation

Idea :Propp & Wilson(1996)- reverse time- run N parallel trajectories- wait for coupling.

Zn = Φ(Φ(· · · (Φ(X , U−n+1), · · · ), U−1), U0).

potential set of reachable states at step n

for all x ∈ X doy(x) ← x

end forrepeat

u ← Random;for all x ∈ X do

y(x) ← y(Φ(x, u));end for

until All y(x) are equalreturn y(x)

[email protected] – ACI SurePath – Paris – 14/10/04 – 11

Page 12: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0

Z0 = X

[email protected] – ACI SurePath – Paris – 14/10/04 – 12

Page 13: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1

Z0 = X

[email protected] – ACI SurePath – Paris – 14/10/04 – 13

Page 14: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1

Z0 = XZ1 = {0000, 0010, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 14

Page 15: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2

Z0 = XZ1 = {0000, 0010, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 15

Page 16: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2

Z0 = XZ1 = {0000, 0010, 0100, 1000}Z2 = {0000, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 16

Page 17: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3

Z0 = XZ1 = {0000, 0010, 0100, 1000}Z2 = {0000, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 17

Page 18: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3

Z0 = X Z3 = {0000, 0100, 1000}Z1 = {0000, 0010, 0100, 1000}Z2 = {0000, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 18

Page 19: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4

Z0 = X Z3 = {0000, 0100, 1000}Z1 = {0000, 0010, 0100, 1000}Z2 = {0000, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 19

Page 20: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4

Z0 = X Z3 = {0000, 0100, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000}Z2 = {0000, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 20

Page 21: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5

Z0 = X Z3 = {0000, 0100, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000}Z2 = {0000, 0100, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 21

Page 22: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5

Z0 = X Z3 = {0000, 0100, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 22

Page 23: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6

Z0 = X Z3 = {0000, 0100, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 23

Page 24: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6

Z0 = X Z3 = {0000, 0100, 1000} Z6 = {0000, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 24

Page 25: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6U7

Z0 = X Z3 = {0000, 0100, 1000} Z6 = {0000, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 25

Page 26: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6U7

Z0 = X Z3 = {0000, 0100, 1000} Z6 = {0000, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000} Z7 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 26

Page 27: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6U7U8

Z0 = X Z3 = {0000, 0100, 1000} Z6 = {0000, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000} Z7 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 27

Page 28: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6U7U8

Z0 = X Z3 = {0000, 0100, 1000} Z6 = {0000, 1000}Z1 = {0000, 0010, 0100, 1000} Z4 = {0000, 1000} Z7 = {0000, 1000}Z2 = {0000, 0100, 1000} Z5 = {0000, 1000} Z8 = {0000}

[email protected] – ACI SurePath – Paris – 14/10/04 – 28

Page 29: Aci SurePath - imag

Backward simulation example

Time

States

0000

0001

0010

0011

0100

0101

0110

1000

1001

1010

1100

−4 −3 −2 −1−5−6−7−8−9−10 0U1U2U3U4U5U6U7U8

τ∗

Process stops when |Zn| = 1

Stopping time τ∗ = 8

Number of computation of Φ (complexity) : n.τ ∗

[email protected] – ACI SurePath – Paris – 14/10/04 – 29

Page 30: Aci SurePath - imag

Backward coupling simulation

Proposition 1 (Propp & Wilson) If τ∗ < +∞ a.s. then the returned value is stationarydistributed.

Proof :{Zn}n∈N is non-increasing and constant for n sufficiently large

Φ(Φ(· · · (Φ(X , U−n+1), · · · ), U−1), U0)L∼ Φ(Φ(· · · (Φ(X , U1), · · · ), Un−1), Un)

Remarks :Stopping times τ and τ∗ have the same law,τ depends on Φ coding (not only on the transition matrix !)

⇒ optimization problem

[email protected] – ACI SurePath – Paris – 14/10/04 – 30

Page 31: Aci SurePath - imag

Partially ordered state space

X is partially ordered :- set M of maximum- set m of minimum- example : vector and componentwise comparisonThe global scheme is

Propp & Wilson : double period of simulation

Fill : interruptible forward algorithm

[email protected] – ACI SurePath – Paris – 14/10/04 – 31

Page 32: Aci SurePath - imag

Monotonous Perfect

MONOTONICITY:Propp & Wilson(1996)- reverse time- run parallel trajectories |M |+ |m|- wait for coupling.

Zn = Φ(Φ(· · · (Φ(M∪m, U−n+1), · · · ), U−1), U0).

potential set of reachable states from maxima

and minima at time n.

n=0;repeat

n=n+1;R[n]=Random;for all x ∈M ∪m do

y(x) ← x

end forfor i=n downto 1 do

for all x ∈M ∪m doy(x) ← Φ(y(x), R[i])

end forend for

until All y(x) are equalreturn y(x)

[email protected] – ACI SurePath – Paris – 14/10/04 – 32

Page 33: Aci SurePath - imag

Monotonous Perfect

MONOTONICITY:Propp & Wilson(1996)- reverse time- run parallel trajectories |M |+ |m|- wait for coupling.

Zn = Φ(Φ(· · · (Φ(M∪m, U−n+1), · · · ), U−1), U0).

potential set of reachable states from maximaand minima at time n.

Optimal coupling time : complexity O(Eτ)

Storage of random sequence

n=1repeat

n=2n;for all x ∈M ∪m do

y(x) ← x

end forfor i=n downto n/2 do

R[i]=Random;end forfor i=n downto 0 do

for all x ∈M ∪m doy(x) ← Φ(y(x), R[i])

end forend for

until All y(x) are equalreturn y(x)

[email protected] – ACI SurePath – Paris – 14/10/04 – 33

Page 34: Aci SurePath - imag

Monotone routing (1)

Queueing network- K queues, capacity Ci for queue i

- State space X = {0, · · · , C1} × · · · × {0, · · · , CK}- event e

Routing strategy (overflow):- origin queue i

- destination list j1, · · · , jk

- rate λe

according to a state x event e route a customer from queue i to the first non-full queue inthe list of destinations. If all destinations are full the customer is routed out of thenetwork (rejection).

Proposition 2 The event e routing with rejection is monotonous.

x 6 y ⇒ Φ(x, e) 6 Φ(y, e)

- If queue i is empty, nothing is done

- Arrival is a routing with overflow

[email protected] – ACI SurePath – Paris – 14/10/04 – 34

Page 35: Aci SurePath - imag

Monotone routing (2)

Routing strategy (blocking):- origin queue i

- destination list j1, · · · , jk

- rate λe

according to a state x event e route a customer from queue i to the first non-full queue inthe list of destinations. If all destinations are full the customer stay in its queue and runits service again.

Proposition 3 The event e routing with blocking is monotonous.

x 6 y ⇒ Φ(x, e) 6 Φ(y, e)

- If queue i is empty, nothing is done- destination list j1, · · · , jk, i

[email protected] – ACI SurePath – Paris – 14/10/04 – 35

Page 36: Aci SurePath - imag

Monotone routing (3)

Routing strategy (JSQ):- origin queue i

- destination list j1, · · · , jk

- rate λe

according to a state x event e route a customer from queue i to the lowest non-full queuein the list of destinations. If all destinations are full the customer stay in its queue and runits service again or is rejected from the network.

Proposition 4 The event e routing with JSQ policy is monotonous.

x 6 y ⇒ Φ(x, e) 6 Φ(y, e)

- If queue i is empty, nothing is done

[email protected] – ACI SurePath – Paris – 14/10/04 – 36

Page 37: Aci SurePath - imag

Uniformization

Each event is driven by a Poisson process- λj rate of event ej

Define Λ =∑

λi the uniformized process with rate Λ

With probability λi

Λevent ei occurs, if ei is not admissible

the transition is skipped.

Theorem 1 Markovian queueing networks with monotonerouting policies have an uniformized version which ismonotonous.

⇒ Monotonous Perfect Simulation

[email protected] – ACI SurePath – Paris – 14/10/04 – 37

Page 38: Aci SurePath - imag

General architecture of Ψ2

Model description specification : textual file

Coupling function : C file (optional)

Simulation parameters : textual file

Unix-like command : psi2_unix -i model.txt -o result.txt -pparam.txt -c couplage.c

[email protected] – ACI SurePath – Paris – 14/10/04 – 38

Page 39: Aci SurePath - imag

Example queue : model

#nombre_de_files

1

#capacite_des_files

10

#etat_initial_mini_des_files

0

#etat_initial_maxi_des_files

10

#nombre_evenements

2

#tableau_des_evenements

#evt_id-evt_typ-taux-nb_fi_evt-origine-destin1-destin2-destina3

0 0 0.4 3 -1 0 -1

1 0 1.7 2 0 -1

[email protected] – ACI SurePath – Paris – 14/10/04 – 39

Page 40: Aci SurePath - imag

Example queue : param

#nombre_echantillons

10000

#taille_trajectoire_maxi

100000000

#germe_generateur

5

[email protected] – ACI SurePath – Paris – 14/10/04 – 40

Page 41: Aci SurePath - imag

Example queue : result

# numero d’echantillon ECHN

# nombre d’iterations NBITER

# etat final sup de la file de numero n EFSFN

# etat final inf de la file de numero n EFIFN?

#ECHN: NBITER: EFSFN: 0 EFIFN: 0

#=============================

0 5 1 1

1 5 1 1

2 5 0 0

3 4 0 0

4 5 0 0

# taille 5 duree d’un tirage : 136.200000 micro-secondes

# valeur initiale du randomize 5

[email protected] – ACI SurePath – Paris – 14/10/04 – 41

Page 42: Aci SurePath - imag

Validation

Analytical models :- single queue- erlang models

⇒ adequation statistical tests χ2

[email protected] – ACI SurePath – Paris – 14/10/04 – 42

Page 43: Aci SurePath - imag

Demo

[email protected] – ACI SurePath – Paris – 14/10/04 – 43

Page 44: Aci SurePath - imag

Interconnexion networks

Delta 8× 8 network, homogeneous

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

0

1

2

3

4

5

6

7

10

9

8

[email protected] – ACI SurePath – Paris – 14/10/04 – 44

Page 45: Aci SurePath - imag

Interconnexion networks

Results

# taille 1000 duree d’un tirage : 135911.287000 micro-secondes

# valeur initiale du randomize 5

Coupling time : 217 with probability 0.45 and 218 with probability 0.55

Marginal distributionsQueue 63

0

10

20

30

40

50

60

70

80

90

100

0 10 20 30 40 50 60 70

"hist32-file63"

[email protected] – ACI SurePath – Paris – 14/10/04 – 45

Page 46: Aci SurePath - imag

Conclusion (1)

Theoretical results :- reverse scheme + contracting operator- coupling condition- monotonous transitions- functional reduction

Algorithmic results:- generic representation of QN- guaranteed coupling algorithm- compact representation

Experimental results- complexity reduction- significant results (depending on the diameter and the coding of the network andcapacities

[email protected] – ACI SurePath – Paris – 14/10/04 – 46

Page 47: Aci SurePath - imag

Conclusion (2)

Software tool: PSI 2 : Perfect Simulator

http://www-id.imag.fr/Software/PSI2/

unix command / with a simple interfacepsi2 unix -i example.txt -p param.txt -c cost.c -o example.out

example.cost associates to each state its costgenerates samples of costs stationary distributed (example.sample)

[email protected] – ACI SurePath – Paris – 14/10/04 – 47

Page 48: Aci SurePath - imag

Future works

Theoretical improvements:- deeper understanding of Φ properties and the spectrum of the transition matrix- evaluation or bounds on the coupling time

Algorithmic perspectives:- storage of random sequences,- memory utilization,- parallelization

Model based approach :- generalization to other modelling frameworks (QN, SAN, GSPN, PA,...)- non-monotone events- model properties : monotonicity, reversibility,...

Experimental results- find limit models- significant results (estimation of rare events probability)- more examples

[email protected] – ACI SurePath – Paris – 14/10/04 – 48