A core Course on Modeling

Slides:



Advertisements
Similar presentations
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.14.
Advertisements

A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.24.
Abstraction Lecture-4. ADT example: London Underground Map.
Using the Crosscutting Concepts As conceptual tools when meeting an unfamiliar problem or phenomenon.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.2.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.16.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 CS 106, Winter 2009 Class 2, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
© 2005 Prentice Hall12-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.8.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.28.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.15.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.31.
Simulation II IE 2030 Lecture 18. Outline: Simulation II Advanced simulation demo Review of concepts from Simulation I How to perform a simulation –concepts:
Concurrency: introduction1 ©Magee/Kramer Concurrency State Models and Java Programs Jeff Magee and Jeff Kramer.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.15.
Dynamic Games & The Extensive Form
Earth Science Daily Challenge, 9/17
Introduction to programming in the Java programming language.
Earth Science Daily Challenge, 9/9 What is a MODEL? Give at least 4 different examples of models.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.19.
1 A Core Course on Modeling      Contents      Change needs Time Introduction to Processes States and State Charts Applying State Charts Time.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.14.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.32.
Covenant College November 27, Laura Broussard, Ph.D. Professor COS 131: Computing for Engineers Chapter 5: Functions.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.25.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.12.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.10.
Reinforcement Learning AI – Week 22 Sub-symbolic AI Two: An Introduction to Reinforcement Learning Lee McCluskey, room 3/10
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.9.
Introduction to Hardware Verification ECE 598 SV Prof. Shobha Vasudevan.
Winter 2007SEG2101 Chapter 121 Chapter 12 Verification and Validation.
Metadata Information about information. What is the information here? Say we have part of a data set: What do these numbers signify?
The Practice of Statistics Third Edition Chapter 11: Testing a Claim Copyright © 2008 by W. H. Freeman & Company Daniel S. Yates.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.2.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.29.
Why do some things attract each other and other don’t?
Introduction to Software Modeling
Operant Conditioning The Main Features of Operant Conditioning: Types of Reinforcement and Punishment.
ENTERPRISE MODELLING KSI 1404
INTRODUCTION TO GENERAL MANAGEMENT
CHAPTER 7 LINEAR RELATIONSHIPS
MEmos.
Basic Guide to Writing an Essay
Basic Guide to Writing an Essay
The accounting cycle is a series of steps done in each accounting period to keep records in an orderly fashion. You can use the general journal to record.
NEW Behavior Log is filled out for 10/10/16
Home.
Time for notetaking FLASHCARDS!
The Future of Software Engineering: Tools
How to take notes… The Crainum Way!
The World of Physical Science Chapter 1
Introduction to Science: The Scientific Method
Attributes and Values Describing Entities.
Instructor: Alexander Stoytchev
Copyright © Cengage Learning. All rights reserved.
A core Course on Modeling
Discrete Mathematics CMP-101 Lecture 12 Sorting, Bubble Sort, Insertion Sort, Greedy Algorithms Abdul Hameed
Review: Design Pattern Structure
Guest Lecture by David Johnston
Statistical Data Analysis
Introduction to Requirements Modeling
ECE 352 Digital System Fundamentals
Basic Guide to Writing an Essay
Building Valid, Credible, and Appropriately Detailed Simulation Models
CS2013 Lecture 7 John Hurley Cal State LA.
Scatter Diagrams Slide 1 of 4
Decimals: Connections to the Common Core and the IES Practice Guide
Presentation transcript:

A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 c.w.a.m.v.overveld@tue.nl v.a.j.borghuis@tue.nl S.14

the secret life of socks Purpose: the model should … Running example: the secret life of socks Purpose: the model should … help decide which socks to wear help decide when to wash socks http://commons.wikimedia.org/wiki/File:Socks_III.jpg 2

Step 1: conceptual model with properties: mySocks=[pair1:pairOfSocks, ...] pairOfSocks:[lSock:sock,rSock:sock]; sock:[where:{closet,on,wash}, hygiene:{clean... dirty}]; pair1.lSock.where == closet pair2.rSock.where == on pair3.lSock.hygiene == dirty pair2.rSock.where == wash means: left sock of pair1 is stored away means: I am wearing the right sock of pair2 means: the left sock of pair3 is dirty means: the right sock of pair 2 is being washed 3

Describe processes: statecharts Both socks of pair1 are in the closet and clean Right sock of pair1 is in the closet; I wear left sock of pair1 Right sock of pair1 is in the closet; I wear left sock of pair1; it is somewhat dirty put on left sock of pair1 left sock gets dirty Do we need to build a completely new model from scratch whenever something in the modeled system changes? Inefficient! intuition: describe a process by relating states (=‘freezes’ or ‘snapshots’) of the system 4

State = all properties in the conceptual model with their values State space = the collection of all states A behavior = a route through statespace A process = the collection of behaviors 5

6 Left sock of pair1 is being washed Right sock of pair1 is in the closet Left sock of pair1 is being washed Right sock of pair1 is in the closet Left sock of pair1 is in the closet; I wear right sock of pair1 Both socks of pair1 are in the closet and clean Right sock of pair1 is being washed left sock of pair1 is in the closet Right sock of pair1 is in the closet; I wear left sock of pair1; it is somewhat dirty Both socks of pair1 are in the closet and clean Right sock of pair1 is in the closet; I wear left sock of pair1 I wear both socks of pair1; left sock is dirtier than right sock I wear right sock of pair2; I wear left sock of pair1; left sock is somewhat dirty 6

A real-life example: controlling a parking garage 7

State and process explosion With n quantities, each mi values, nr states = i=1 … n mi. Number of behaviors with p steps = j=1 … p i=1 … n mi. State and process explosion http://www.clipartlord.com/wp-content/uploads/2012/10/bomb-explosion-300x234.png State = all properties in the conceptual model with their values State space = the collection of all states A behavior = a route through statespace A process = collection of behaviors of a system 8

the state space contains 3 x 10 x 3 x 10 = 900 states. For 1 pair of socks, pairOfSocks: [lSock: sock, rSock: sock]; sock: [where: {closet,on,wash}, hygiene:{clean... dirty}], say 10 steps from clean ... dirty the state space contains 3 x 10 x 3 x 10 = 900 states. For 2 pair: 900 x 900 = 810000 states, etc. 9

the state space contains 3 x 10 x 3 x 10 = 900 states. QUIZ For 1 pair of socks, pairOfSocks: [lSock: sock, rSock: sock]; sock: [where: {closet,on,wash}, hygiene:{clean... dirty}], say 10 steps from clean ... dirty the state space contains 3 x 10 x 3 x 10 = 900 states. For 2 pair: 900 x 900 = 810000 states, etc. A sock might also contain a hole. What is the consequence for the statespace of a pair of socks if we take this into account? 10

the state space contains 3 x 10 x 3 x 10 = 3600 states. For 1 pair of socks, pairOfSocks: [lSock: sock, rSock: sock]; sock: [where: {closet,on,wash}, hygiene:{clean... dirty}], say 10 steps from clean ... dirty the state space contains 3 x 10 x 3 x 10 = 3600 states. For 2 pair: 900 x 900 = 810000 states, etc. Parking garage: 1080 states (incl. folded cars!) 11

Idea: hiding and exposing quantities or values 12 http://commons.wikimedia.org/wiki/File:%D0%AF_%D0%B7%D0%B0_%D0%BA%D0%B0%D0%BC%D0%BD%D0%B5%D0%BC.jpg 12

Decrease amount of states: distinguish exposed and hidden quantities or values, focus on the exposed ones. Exposed quantities or values: externally visible or accessible Hidden quantities or values: internal behaviour, may help explaining seemingly uncausal exposed behavior Which quantities need exposure: depends on purpose of the model Which quantities may be hidden: as much as possible to simplify model 13

value ‘closet’ can be hidden for property ‘where’; what to hide?  purpose to decide washing: value ‘closet’ can be hidden for property ‘where’; to decide which socks to wear: hygiene values between ‘clean’ and ‘dirty’ can be hidden. Only ‘clean’ and ‘not clean’ matter. purpose asks for something that mimics the physical pen, hence the choices for which properties are visible and which are not 14

Example: 1 pair of socks wearing washing lSock.where==on rSock.where==on lSock.hygiene==clean rSock.hygiene==clean lSock.where==wash rSock.where==wash lSock.hygiene==dirty rSock.hygiene==dirty washing Assume that we don’t put socks in the closet, and we don’t bother to distinguish various levels of dirty. 15

ignores socks can get separated ignores multiple pairs of socks Example: 1 pair of socks Too naive: ignores closet-state ignores socks can get separated ignores multiple pairs of socks The challenge is to find a statechart that is more subtle than merely the two states version does not have to resort on full state space 16

First: look at 1 sock where==closet hygiene==clean where==wash where==on hygiene==clean where==on hygiene!=clean 17

First: look at 1 sock: change 1 property at once where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 18

First: look at 1 sock: change at least one property where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 19

First: look at 1 sock: change at least one property where==closet hygiene==clean where==wash hygiene!=clean QUIZ where==closet hygiene!=clean Which state transitions are forbidden if at least one property has to change? where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 20

First: look at 1 sock: change at least one property where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 21

First: look at 1 sock: transitions in both directions are distinct where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 22

First: look at 1 sock: transitions in both directions are distinct where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 23

First: look at 1 sock: socks don’t get dirty unless being worn where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 24

First: look at 1 sock: socks only get clean by washing where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 25

First: look at 1 sock: socks only get clean by washing where==closet hygiene==clean where==wash hygiene!=clean QUIZ where==closet hygiene!=clean Which state transitions are forbidden if socks only get clean by washing? where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 26

First: look at 1 sock: socks only get clean by washing where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 27

First: look at 1 sock: only put on clean socks where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 28

First: look at 1 sock: don’t put dirty socks in the closet where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 29

First: look at 1 sock: don’t put dirty socks in the closet where==closet hygiene==clean where==wash hygiene!=clean QUIZ where==closet hygiene!=clean Which state transitions are forbidden if we don’t put dirty socks in the closet? where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 30

First: look at 1 sock: don’t put dirty socks in the closet where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 31

First: look at 1 sock: don’t put clean socks in the wash where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 32

First: look at 1 sock: don’t put worn socks into the closet where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 33

First: look at 1 sock: some states are unreachable where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 34

First: look at 1 sock: the life cycle for a single sock where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean where==wash hygiene==clean where==on hygiene==clean simulate where==on hygiene!=clean 35

Next: look at 2 socks: the life cycle for a pair of socks where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean pair1.rSock where==wash hygiene==clean where==on hygiene==clean where==closet hygiene==clean where==on hygiene!=clean where==wash hygiene!=clean where==closet hygiene!=clean pair1.lSock where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 36

Next: look at 2 socks: the life cycle for a pair of socks QUIZ where==closet hygiene==clean In which state transition(s) for lSock should we inspect the state of rSock, and vice versa? where==wash hygiene!=clean where==closet hygiene!=clean pair1.rSock where==wash hygiene==clean where==on hygiene==clean where==closet hygiene==clean where==on hygiene!=clean where==wash hygiene!=clean where==closet hygiene!=clean pair1.lSock where==wash hygiene==clean where==on hygiene==clean where==on hygiene!=clean 37

Next: look at 2 socks: the life cycle for a pair of socks only allowed if pair1.rSock.hygiene == clean where==closet hygiene==clean where==wash hygiene!=clean where==closet hygiene!=clean pair1.rSock where==wash hygiene==clean where==on hygiene==clean where==closet hygiene==clean where==on hygiene!=clean where==wash hygiene!=clean where==closet hygiene!=clean pair1.lSock where==wash hygiene==clean where==on hygiene==clean only allowed if pair1.lSock.hygiene == clean where==on hygiene!=clean 38

Next: look at 2 socks: the life cycle for a pair of socks QUIZ only allowed if pair1.rSock.hygiene == clean where==closet hygiene==clean Thusfar, we only looked at the behavior for one pair of socks. How do further pairs of socks get involved in the process? where==wash hygiene!=clean where==closet hygiene!=clean pair1.rSock where==wash hygiene==clean where==on hygiene==clean where==closet hygiene==clean where==on hygiene!=clean where==wash hygiene!=clean where==closet hygiene!=clean pair1.lSock where==wash hygiene==clean where==on hygiene==clean only allowed if pair1.lSock.hygiene == clean where==on hygiene!=clean 39

Communicating and Synchronizing processes Statecharts: Communicating and Synchronizing processes http://www.morguefile.com/archive?referrer=1660250&srh_field=wine+tasting#/?q=orchestra&photo_lib=morgueFile 40

Statecharts: Simulate processes Analyse processes Optimize processes Verify: desired states are reached? Verify : forbidden states cannot be reached? 41

Statecharts: Simulate processes Analyse processes Optimize processes Verify: desired states are reached? Verify : forbidden states cannot be reached? Reduce processes (hiding / exposing) predict: see when/if a particular state occurs (or: a state with a certain property), or examine the properties of a given (future) state specify: give desired proporties of some final state verify: check that a certain state cannot occur analyse if there no are deadlocks (=dead end routes) analyse if states that should be reached can be reached analyse if states that should be reached in some order are reached in that order analyse if occurring transitions are permitted (while monitoring a system) 42

... what about the automated garage? http://www.sxc.hu/browse.phtml?f=download&id=191768 Statecharts: ... ... what about the automated garage? model was reduced from 1080 to 3.3 x 106 states… and could be analysed by computer 43

Summary: state: properties and values in a certain situation transition: go from one state to a next state space: collection of states behavior: route through state space process: collection of behaviors state explosion: processes amount to very many states hiding / exposing: simplifying process by reducing values or properties (given a purpose) state chart: formal representation of process 44