Queueing & Python · Queueing & Python pip install ciw Geraint Ian Palmer @GeraintPalmer@CiwPython...

Post on 07-Oct-2020

6 views 0 download

Transcript of Queueing & Python · Queueing & Python pip install ciw Geraint Ian Palmer @GeraintPalmer@CiwPython...

Queueing & Pythonpip install ciw

Geraint Ian Palmer@GeraintPalmer @CiwPython

PyCon UK 2016

CiwCiw

What is a Queue?

µΛ

What is a Queue?

n1 µ1

µ2

µ2

Λ1

Λ2

r12r21

r11

r22

Features

http://ciw.readthedocs.io

Distributions

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.0 0.1 0.2 0.3 0.4 0.5 0.6

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.0 0.1 0.2 0.3 0.4 0.5 0.60.0

0.1

0.2

0.3

0.4

0.5

Priority Queues

µ

Λ?

Λ

Baulking

µΛ Too long?

P(baulk | x in queue) = b(x)

b(x) =

x20 if x ≤ 2x

x+3 if 2 < x ≤ 10

1 otherwise

0 2 4 6 8 10 12 14 16

x

0.0

0.2

0.4

0.6

0.8

1.0

b(x)

Server Schedules

Λ

µ

µ

µ

Server Schedules

Λ µ

Server Schedules

Λ

Server Schedules

Λ

µ

µ

Server Schedules

Λ

µ

µ

µ

Server Schedules

Λ µ

Server Schedules

Λ

Server Schedules

Λ

µ

µ

On duty, not busy On duty, busy Off duty, busy

0 40 65 110 150

Server 1 for (−40, 0)

Server 2 for (−40, 0)

Server 3 for (−40, 0)

Server 1 for (0, 40)

Server 1 for (65, 110)

Server 2 for (65, 110)

Server 1 for (110, 150)

Server 2 for (110, 150)

Server 3 for (110, 150)

Server 1 for (150, 190)

CiwVis

https://ciwpython.github.io/CiwVis/

Academic Uses

Theoretical WorkInvestigating deadlock in queueing networks.(Geraint Palmer, Prof. Paul Harper, Dr. Vincent Knight)

Practical WorkModelling an ophthalmology clinic to strategise scheduling.(Lieke Holscher, Dr. Jennifer Morgan)

Investigating Deadlock

A1

B1

B2

C1

C2

B1

C1

A1

B2

A1

B1

B2

C1

C2

B1

A1

B2

A1

B1

B2

Investigating Deadlock

A1

B1

B2

C1

C2

B1

C1

A1

B2

A1

B1

B2

C1

C2

B1

A1

B2

A1

B1

B2

1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0

µ

0

5

10

15

20

25Ti

me

to D

eadl

ock

from

(0)

Expected Time to Deadlock From State (0)Analytical MeanSimulation Results

Modelling Ophthalmology Clinic

12

3

4567

8

9

1011 12

12

3

4567

8

9

1011 12

12

3

4567

8

9

1011 12

Thank you!

@GeraintPalmer@CiwPython

http://ciw.readthedocs.io

https://github.com/geraintpalmer/Ciw

https://ciwpython.github.io/CiwVis/

CiwCiw