Modelling, analyzing and control of DES and DEDS

132
1 Modelling, analyzing and control of DES and DEDS (Compendium of the recent research) František Čapkovič Presentation in University of Aizu October 11, 2006

Transcript of Modelling, analyzing and control of DES and DEDS

Page 1: Modelling, analyzing and control of DES and DEDS

1

Modelling, analyzing andcontrol of DES and DEDS (Compendium of the recent research)

František Čapkovič

Presentation in University of Aizu

October 11, 2006

Page 2: Modelling, analyzing and control of DES and DEDS

2

Author's address

František ČapkovičInstitute of Informatics, Slovak Academy of Sciences

Dúbravská cesta 9, 845 07 Bratislava, Slovak Republic

e-mail: [email protected]

http://www.ui.sav.sk/home/capkovic/capkhome.htm

Page 3: Modelling, analyzing and control of DES and DEDS

3

Contents

IntroductionBasic definition of DEDSPetri nets in DEDS modellingDirected graphs in DEDS modelling

DEDS control synthesisDefinition of the control synthesis

Basic principle of the proposed control synthesismethod

Page 4: Modelling, analyzing and control of DES and DEDS

4

ExamplesClient-server cooperationTwo agents cooperation

AdaptivitySimple example

Petri nets in problem solvingProblem solving and causalityPetri nets & reachability graphs in problem solving

Page 5: Modelling, analyzing and control of DES and DEDS

5

Problem solving & DESSolving the DES control synthesis problemAgent-based approach to DES control synthesisExample – the maze problem solving

Approaches to solving the problemMutual intersection of autonomous solutionsSolving the global problem in the wholeUtilizing P-invariants of Petri net based model

Page 6: Modelling, analyzing and control of DES and DEDS

6

Modular approach to agents modellingEngineering applications

Assembly & disassembly process

Flexible manufacturing system

Conclusions

Page 7: Modelling, analyzing and control of DES and DEDS

7

The graphical expression of a DEDS dynamics development

Page 8: Modelling, analyzing and control of DES and DEDS

Causality

Page 9: Modelling, analyzing and control of DES and DEDS

9

Why Petri nets in DEDS modelling ????PN are able to express parallelism and conflict situationsPN can be expressed in analytical terms (in the form of the linear discrete system) as well as in the graphical formPN properties can be tested by means of the reachability tree and invariantsPN allow to use analytical approach to the DEDS control synthesisPN make possible to quantify (model) problems that

are given e.g. only verbally

Page 10: Modelling, analyzing and control of DES and DEDS

10

An example of a Petri net

Page 11: Modelling, analyzing and control of DES and DEDS

11

Parallelism

Page 12: Modelling, analyzing and control of DES and DEDS

12

Conflict situation

Page 13: Modelling, analyzing and control of DES and DEDS

13

Formal expression of the Petri net structure

Set of the PN places

Set of PN transitions

Set of PN arcs from places to transitions

Set of PN arcs from transitions to places

Page 14: Modelling, analyzing and control of DES and DEDS

14

Formal expression of the Petri net dynamics

Set of state vectors

Set of control vectors

Transition function

Page 15: Modelling, analyzing and control of DES and DEDS

15

Mathematical model of the Petri net

Page 16: Modelling, analyzing and control of DES and DEDS

16

A more general PN-based mathematical model of DEDS (with the multiplicity of arcs)

Page 17: Modelling, analyzing and control of DES and DEDS

17

Reachability tree of the above introduced Petri net

Page 18: Modelling, analyzing and control of DES and DEDS

18

Directed graphs (DG) in DEDS modelling

Page 19: Modelling, analyzing and control of DES and DEDS

19

Graph-based modelg

Tag

Page 20: Modelling, analyzing and control of DES and DEDS

20

State machines

Petri nets where each transition has only one input and only one output position are named state machines.They can be modelled by directed graphs (DG) without any problem.

Petri nets with general structure

In case of the general structure, when any transition is allowed to have more input positions and more output ones, the PN reachability graph has to be used.

Page 21: Modelling, analyzing and control of DES and DEDS

21

Petri netmodel

Reachabilitytree

Reachabilitygraph

Real DEDS

Graph model

Controlsynthesis

Transforming the PN model to the DG model

Page 22: Modelling, analyzing and control of DES and DEDS

22

DEDS control synthesis

Definition of the control synthesis

Control synthesis = finding the most suitable sequence of discrete events (control interferences) which is able to ensure the transition (transformation) of the system from a given initial state into a prescribed terminal state at simultaneous fulfilling control task specifications that are imposed on the control task.

Control task specifications = criteria, constraints, etc.Usually, they are not given in analytical terms. Even, often they are given only verbally.

Page 23: Modelling, analyzing and control of DES and DEDS

23

Basic principle of the proposed control synthesis method

Straight-lined reachability tree and the backtracking one

Page 24: Modelling, analyzing and control of DES and DEDS

24

Intersection of the trees yields the state trajectory(-ies)

Page 25: Modelling, analyzing and control of DES and DEDS

25

Procedure in analytical terms

• The staight-lined reachability tree (SLRT)

Page 26: Modelling, analyzing and control of DES and DEDS

26

• The backtracking (backward) reachability tree (BTRT)

Page 27: Modelling, analyzing and control of DES and DEDS

27

The intersection of the SLRT and BTRT

Page 28: Modelling, analyzing and control of DES and DEDS

28

Using the principle of causalityDue to the principle of causality any shorter feasiblesolution is involved in the longer feasible one. Hence, when

Page 29: Modelling, analyzing and control of DES and DEDS

29

Shorter trajectories obtained by shifting

Page 30: Modelling, analyzing and control of DES and DEDS

30

Example 1 – Client-server connectionThe places of the PN-based model

p1 - the client (C) requests for the connectionp2 - the server (S) is listeningp3 - the connection of C with Sp4 - the data sent by C to Sp5 - the disconnection of C by the C himself

The transitions of the PN-based model

t1, t2, t3 – discrete events realizing the system dynamics

Page 31: Modelling, analyzing and control of DES and DEDS

31

PN-based model and corresponding reachability tree

Page 32: Modelling, analyzing and control of DES and DEDS

32

Parameters of the PN-based model

Page 33: Modelling, analyzing and control of DES and DEDS

33

MATLAB procedure for enumerating the RT

Page 34: Modelling, analyzing and control of DES and DEDS

34

Page 35: Modelling, analyzing and control of DES and DEDS

35

Enumerated RT

Quasi-functional adjacency matrix of RT

Page 36: Modelling, analyzing and control of DES and DEDS

36

Space of reachable states

Page 37: Modelling, analyzing and control of DES and DEDS

37

Example 2 – Two agents cooperation

The agent A needs to do the activity (i.e. to solve a problem) P. However, A is not able to do P. Consequently, A requests the agent B to do P for him.

The places of the PN-based model:

p1 – A wants to do Pp2 - A waits for an answer from Bp3 - A waits for a help from Bp4 - the failure of the cooperationp5 - the satisfying cooperationp6 - A requests B to do Pp7 - B refuses to do P

Page 38: Modelling, analyzing and control of DES and DEDS

38

p8 - B accepts the request of A to do Pp9 - B is not able to do P

p10 - doing P by Bp11 - B receives the request of Ap12 - B is willing to do P for Ap13 - the end of the work of B

The transitions of the PN-based model:

t1 – t9 represent discrete events realizing the system dynamics

Page 39: Modelling, analyzing and control of DES and DEDS

39

PN-based model

Page 40: Modelling, analyzing and control of DES and DEDS

40

Enumerated RT

Page 41: Modelling, analyzing and control of DES and DEDS

41

The reachability graph

Page 42: Modelling, analyzing and control of DES and DEDS

42

The space of reachable states

Page 43: Modelling, analyzing and control of DES and DEDS

43

Control synthesis

The initial state

The terminal state – the successful cooperation

Page 44: Modelling, analyzing and control of DES and DEDS

44

The intersection of the SLRT and BTRT

Page 45: Modelling, analyzing and control of DES and DEDS

45

The state trajectories – the successful cooperation

Page 46: Modelling, analyzing and control of DES and DEDS

46

Graphic tool - GraSim

Page 47: Modelling, analyzing and control of DES and DEDS

47

Succesfull cooperation 1

Page 48: Modelling, analyzing and control of DES and DEDS

48

Succesfull cooperation 2

Page 49: Modelling, analyzing and control of DES and DEDS

49

The failured cooperation – when B is not able to do P

Page 50: Modelling, analyzing and control of DES and DEDS

50

Adaptivity (flexibility)

Choosing the most suitable trajectory from the feasible ones in order to adapt the system behaviourto external demands (conditions)Changing the structure of the system model in order to express more kinds of the system behaviour.

Choosing the most suitable behaviour from the feasible ones. It is illustrated in the next example.

There are two kinds of the adaptivity in the DEDS control synthesis

Page 51: Modelling, analyzing and control of DES and DEDS

51

Example 3 – Two processes

Page 52: Modelling, analyzing and control of DES and DEDS

52

{p1, p2, p3} – 1st process P1{p5, p6, p7} – 2nd process P2

p4 – the structural element that is able to influence• the mutual exclusion of P1 and P2• the sequencing of P1 and P2• the re-running of P1 and P2

Page 53: Modelling, analyzing and control of DES and DEDS

53

Page 54: Modelling, analyzing and control of DES and DEDS

54

Page 55: Modelling, analyzing and control of DES and DEDS

55

Exclusion of the process P2

Page 56: Modelling, analyzing and control of DES and DEDS

56

Three possibilities of the P2 exclusion

Page 57: Modelling, analyzing and control of DES and DEDS

57

Causality and problem solving

STRIPS (STanford Research Institute Problem Solver) [Fikes and Nilsson]is associated with the so called block world paradigm.

Petri nets in problem solving

b

c

a

b

c

a

initial state x0 terminal state xN

solving

table

Page 58: Modelling, analyzing and control of DES and DEDS

58

Expressing causality by Petri nets and reachability graphs

A fragment of PN

Full reachability graph

Page 59: Modelling, analyzing and control of DES and DEDS

59

Interpretation of the Petri net places wrt. the problem

p1 – a, b, c are separated on the table (T); {a,b,c}p2 – a, b are separated on T; c is on b; {a,c/b}p3 – a, c are separated on T; b is on c; {a,b/c}p4 – a, b are separated on T; c is on a; {c/a,b}p5 – b, c are separated on T; a is on c; {b,a/c}p6 – b, c are separated on T; a is on b; {a/b,c}p7 – a, c are separated on T; b is on a; {b/a,c}p8 – b is on T ; c is on b ; a is on c; {a/c/b}p9 – c is on T ; b is on c ; a is on b; {a/b/c}p10 - c is on T ; a is on c ; b is on a; {b/a/c}p11 - a is on T ; c is on a ; b is on c; {b/c/a}p12 - b is on T ; a is on b ; c is on a; {c/a/b}p13 - a is on T ; b is on a ; c is on b; {c/b/a}

Page 60: Modelling, analyzing and control of DES and DEDS

60

States as the nodes of the reachability treeSolution of the problem

x0 = (0,0,0,1,0,0,0,0,0,0,0,0,0)’ - the initial statex9 = (0,0,0,0,0,0,0,0,1,0,0,0,0)’ - the terminal state

The solution is

x2 x4x0 x9

where

x2 = (1,0,0,0,0,0,0,0,0,0,0,0,0)’

x4 = (0,0,1,0,0,0,0,0,0,0,0,0,0)’

Page 61: Modelling, analyzing and control of DES and DEDS

61

Solving the DES control synthesis problems

• Agent-based approach

• Engineering applications of AI methods• Block world paradigm

• Hanoi tower paradigm

• Control of the flexible manufacturing system

Page 62: Modelling, analyzing and control of DES and DEDS

62

Agent-based approach to DES control synthesis

Agent A1 Agent A2

Control Agent Ac

Knowledge

Page 63: Modelling, analyzing and control of DES and DEDS

63

Example 4 – Agent-based control synthesis

Problem to be solved – the maze problem

A1A2

Page 64: Modelling, analyzing and control of DES and DEDS

64

Problem formulationMaze consists of 5 rooms denoted as 1, 2, 3, 4, 5

connected by doors c1, c2, …, c7, c8 for A1 anddoors m1, m2, …, m6 for A2.

Initially, A1 is in the room 3, A2 is in the room 5.Doors can be open (closed) by the control agent Ac.Only door c7 is permanently open (uncontrollable).

Agent Ac observes only discrete events fromsensors built-in the doors.

The control synthesis problem is the following:Only door

Page 65: Modelling, analyzing and control of DES and DEDS

65

Control synthesis problem to be solved

To find the feedback controller (a policy of theagent Ac) that will fulfil the conditions:

1. A1, A2 never occupy the same room simul-taneously

2. It is always possible for both of them to return to their initial position

3. The agent Ac should enable both of them to behave as freely as possible (with respect to (1.), (2.) )

Page 66: Modelling, analyzing and control of DES and DEDS

66

Petri net-based model of the agents A1, A2

Agent A1 Agent A2

Page 67: Modelling, analyzing and control of DES and DEDS

67

Parameters of the mathematical models

Agent A1Parameters of the PN-based model

Page 68: Modelling, analyzing and control of DES and DEDS

68

Adjacency matrix of RG and the space of reachablestates

Page 69: Modelling, analyzing and control of DES and DEDS

69

Agent A2

Parameters of the PN-based model

Page 70: Modelling, analyzing and control of DES and DEDS

70

Adjacency matrix of RG and the space of reachablestates

Page 71: Modelling, analyzing and control of DES and DEDS

71

Approaches to solving the problem

I. Mutual intersection of autonomous solutions

II. Solving the global problem in the whole

III. Utilizing the invariants of the Petri nets model

Page 72: Modelling, analyzing and control of DES and DEDS

72

Illustrative exampleI. Mutual intersection of autonomous solutions

Agent A1Autonomous

Page 73: Modelling, analyzing and control of DES and DEDS

73

Agent A2Autonomous

Page 74: Modelling, analyzing and control of DES and DEDS

74

The final solution

Agent A1 Agent A2

Page 75: Modelling, analyzing and control of DES and DEDS

75

Page 76: Modelling, analyzing and control of DES and DEDS

76

Page 77: Modelling, analyzing and control of DES and DEDS

77

II. Solving the global problem in the whole

The PN-based mathematical model

Page 78: Modelling, analyzing and control of DES and DEDS

78

The global solution

Agent A1 Agent A2

Page 79: Modelling, analyzing and control of DES and DEDS

79

Page 80: Modelling, analyzing and control of DES and DEDS

80

Page 81: Modelling, analyzing and control of DES and DEDS

81

Page 82: Modelling, analyzing and control of DES and DEDS

82

Page 83: Modelling, analyzing and control of DES and DEDS

83

III. Utilizing the invariants of the Petri nets model

Additional PN places – the so called slacks – areintroduced

i.e. in our example

Page 84: Modelling, analyzing and control of DES and DEDS

84

Principle of the invariants method

Page 85: Modelling, analyzing and control of DES and DEDS

85

Page 86: Modelling, analyzing and control of DES and DEDS

86

slacks slacks

A1

A2

Page 87: Modelling, analyzing and control of DES and DEDS

87

Page 88: Modelling, analyzing and control of DES and DEDS

88

The final solutionIt is the same as in case II, i.e.:

Page 89: Modelling, analyzing and control of DES and DEDS

89

Page 90: Modelling, analyzing and control of DES and DEDS

90

Comparison of the approaches(I) The approach based on the intersection of the autono-

mous solutions is simple but multiplicative – i.e. the autono-mous solution has to be found for any agent. In addition tothis the process of the intersection has to be performed(II) The global approach solves the problem simultaneously,together with the interconnections among agents. It savesthe computational time, but the problem dimensionality isgreater(III) The approach based on invariants decreases (in com-parison with (II)) the RG, in spite of the fact that it increa-ses the number of the PN places (it adds the slacks)

Page 91: Modelling, analyzing and control of DES and DEDS

91

Modular approach to agents modelling

Page 92: Modelling, analyzing and control of DES and DEDS

Interpretation of PN places

p1 – A is free p11 – A is not able to help

p2 – A has to solve a problem P p12 – A is able to help

p3 – A is able to solve P

p4 – A is not able to solve P

p5 – P is solved

p6 – A contacts another agent

p7 – A asks another agent for help

p8 – A is asked by another agent for help to solve its problem

p9 – A refuses the help

p10 – A accepts the request for help

Page 93: Modelling, analyzing and control of DES and DEDS

93

Interface

Agent 1Agent 2

Page 94: Modelling, analyzing and control of DES and DEDS

94

Incidence matrix F of the PN model of MAS

Page 95: Modelling, analyzing and control of DES and DEDS

95

Incidence matrix G of the PN model of MAS

Page 96: Modelling, analyzing and control of DES and DEDS

96

The feedback control A1 is the controlled system , A2 is the controller

Page 97: Modelling, analyzing and control of DES and DEDS

The feedback

Page 98: Modelling, analyzing and control of DES and DEDS

98

Engineering applications of AI

Assembly & disassembly problem solving:

Exchange of the bad bearing B

Page 99: Modelling, analyzing and control of DES and DEDS

99

Utilizing the block world paradigm

Page 100: Modelling, analyzing and control of DES and DEDS

100

Petri net-based model

Page 101: Modelling, analyzing and control of DES and DEDS

101

p1 – the initial configuration p10 – C is put on E

p2 – D is disassembled p11 – D is put on C

p3 – D is put aside

p4 – C is disassembled

p5 – C is put aside

p6 – A is free of parts

p7 – B is disassembled and put aside

p8 – E is prepared for using

p9 – E is put on A

The interpretation of PN places

Page 102: Modelling, analyzing and control of DES and DEDS

102

The reachability graph

Page 103: Modelling, analyzing and control of DES and DEDS

103

The state space

Page 104: Modelling, analyzing and control of DES and DEDS

104

Utilizing the Hanoi tower paradigm

The initial state of the Hanoi tower puzzle

C

B

A

Page 105: Modelling, analyzing and control of DES and DEDS

105

The terminal state of the Hanoi tower puzzle

Page 106: Modelling, analyzing and control of DES and DEDS

106

Usage of this paradigmThis paradigm can be utilized in assembly when

• the space for putting parts is limited

• the assembled parts have very different mass

• the parts are fragile, etc.

Page 107: Modelling, analyzing and control of DES and DEDS

107

Comparing the puzzle and the assembly process

Page 108: Modelling, analyzing and control of DES and DEDS

108

The PN-based model

Page 109: Modelling, analyzing and control of DES and DEDS

109

p1 – the initial configuration p10 – B is ejected

p2 – D is put on (symbolic) peg 1 p11 – E is available

p3 – the configuration without D p12 – A is free of parts

p4 – the situation on the peg 2

p5 – the configuration without C

p6 – E is put on A

p7 – D is added

p8 – C is added

p9 – the final configuration

The interpretation of the PN-places

Page 110: Modelling, analyzing and control of DES and DEDS

110

Page 111: Modelling, analyzing and control of DES and DEDS

111

The state space

Page 112: Modelling, analyzing and control of DES and DEDS

The flexible manufacturing system

Consider the robotic cell with two conveyors C1, C2, the NC-machine M, with the buffer B (having the input part B1and the output part B2), and the robot R.

Defining the PN places and transitions:

p1 = waiting the input parts t1 = taking from C1 by Rp2 = waiting the output parts t2 = machining by M p3 = R is available t3 = putting on C2 by Rp4 = M is availablep5 = contents of B

Page 113: Modelling, analyzing and control of DES and DEDS

The PN-based model of the FMS

Page 114: Modelling, analyzing and control of DES and DEDS

The reachability tree and reachability graph

Page 115: Modelling, analyzing and control of DES and DEDS

The model parameters

Page 116: Modelling, analyzing and control of DES and DEDS

The RT and state space

Page 117: Modelling, analyzing and control of DES and DEDS

The ambiguity and how to deal with it

When the capacities of places are infinite the ambiguity occurs in the matrix A.

Namely, the cycles engender in the RT and RG. The state space of the reachable states is infinite. Infinity is expressed by the symbol

Hence, in order to find a reasonable solution, the finite capacities of the PN places have to be determined.

Page 118: Modelling, analyzing and control of DES and DEDS

Dealing with the ambiguity

PN model with theinfinite state space

Degenerated RT and RG

Limiting capacitiesof PN placesControl synthesis

problem to be solved

Standard PN model,RT and RG

Page 119: Modelling, analyzing and control of DES and DEDS

The finite capacity

Page 120: Modelling, analyzing and control of DES and DEDS

The finite capacities

Page 121: Modelling, analyzing and control of DES and DEDS

The reachability graph

Page 122: Modelling, analyzing and control of DES and DEDS

The state space of reachable states

Page 123: Modelling, analyzing and control of DES and DEDS

The control synthesis

Page 124: Modelling, analyzing and control of DES and DEDS

Using the system GraSim

Page 125: Modelling, analyzing and control of DES and DEDS

The trajectory No. 3

Page 126: Modelling, analyzing and control of DES and DEDS

The other trajectories

Page 127: Modelling, analyzing and control of DES and DEDS

Intelligent control synthesis

DEDS control task specifications are usually given in nonanalytical terms, often only verbally.

To choose the most suitable trajectory knowled-ge-based approaches must be used.

The knowledge base (KB) expressing the control task specifications in the form of IF-THEN rules can be modelled by means of the logical and/or fuzzy PN. Thus, the KB can be expressed in analytical terms.

Page 128: Modelling, analyzing and control of DES and DEDS

Control taskspecifications

IF-THEN rules

DEDSFeasible

trajectories

Knowledge-based choice of the trajectory

Page 129: Modelling, analyzing and control of DES and DEDS

129

ConclusionsSimple general method of DEDS modelling,analyzing and control synthesis was presen-tedIts applicability to different kinds of systemswas demonstratedA simple general method for agent-basedproblem solving was presentedIts applicability to solving the problem of theDES control synthesis was demonstrated

Page 130: Modelling, analyzing and control of DES and DEDS

130

Three different approaches to the control synthesis of the same DES were illustrated on the example:

Mutual intersection of autonomous solutions of the elementary agentsSolving the global problem in the wholeUtilizing the invariants of Petri net-based model

The approaches were compared and evaluated.

Page 131: Modelling, analyzing and control of DES and DEDS

and finally,

Several engineering applications werepresented to illustrate the applicabilityof the approach

Page 132: Modelling, analyzing and control of DES and DEDS

132

Future work on this way

To innovate presented methods permanentlyTo extend its reasonable applicability forlarger and larger class of DES able to be modelled by Petri netsTo find new methods, procedures and toolsfor DEDS modelling, analyzing and control