1 / 15

Key Terms

Key Terms. Basic action activity composition state event state action state activity state initial state final state. Basic state diagram substate Sequential substate History substate Concurrent substate transition. Advance event trigger message triggerless transition.

phuong
Download Presentation

Key Terms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Key Terms Basic • action • activity • composition state • event • state • action state • activity state • initial state • final state Basic • state diagram • substate • Sequential substate • History substate • Concurrent substate • transition Advance • event trigger • message • triggerless transition

  2. Notation and Semantics State Diagram:描述單一物件其狀態的轉換及順序。 • State(狀態): 在Object 執行過某動作(Action)或某事件(Event)發生後,Object被改變的狀態,其包含2個部份。 • Name Compartment :State 的名稱。 • Internal Transition Compartment:在State內部一連串的 動作, 其語法如 下: • event-name argument-list’[‘guard-condition’]’’/’action-express • 共有3種內定的事件 • ‘entry’’/’action-express:當進入State時,所執行動作 • ‘exit’’/’action-express:當離開State時,所執行的動作 • ‘do’’/’action-express:執行動作 • 除以上3種外,也可以使用者自定 Name Compartment Internal Transition Compartment State Name entry/action exit/action do/action 自訂/action

  3. Example Name Entry action Exit action Internal transition Activity Deferred event Tracking Entry / setMode(ontrack) Exit / setMode(offtrack) Newtarget / tracker.Acquire() Do / followTarget selfTest / defer Advanced states and transition Login entry/type “login” exit/login (user name,password) do/get user name do/get password help/display help

  4. Notation and Semantics shutdown keypress Idle Running finished • Start (開始):State Diagram中所有狀態的開始。 • End (結束): State Diagram的所有狀態的結束。 Start End Example states

  5. Notation and Semantics Transition String State transition Transition (轉變): 由箭頭與Transition String組成,Transition String由物件狀態轉移時的限制(Guard Condition)、 發生的事件(Event)或執行的動作(Action)所組成 ,其 語法如下: event-signature ‘[‘guard-condition’]’ ‘/’ action-express ‘^’ send-clause。 E1 (p:C) [cond] / action1;action2 Source state target state State transition

  6. Example Time event send signal self-transition event trigger trigerless transition After (2seconds)/ send c.isAlive noise Idle Searching Engaging TargetAt(p) [isTheat] / t.addTarget(p) Tracking Engaging contact Transition example Action Event trigger with parameters guard condition

  7. Notation and Semantics Superstate State A State B State C State D Examples maintain CompositeState (合成狀態):整個State稱為Superstate,State A、 B、C、D稱為Substate, State A與 State B的關係為or的關係, State C與 State D,關係也是or,而用虛線隔開 的上下兩者關係為and。 Idle maintenance Testing Idle Searching Commanding [continue] Idle Searching [not continue] keyPress Concurrent substates

  8. Example Active cardinserted Validating Ready / turnON() Idle [continue] cancel maintain processing selecting [not continue] Maintenance printing Entry / readCard Exit / ejectcard Sequential substates

  9. Notation and Semantics Examples: Backing Up selecting H command query copying Cleaning up History State History indicator:記錄Superstate內部的狀態,當再回到Superstate時,能回到離開時的狀態。 Superstate H

  10. Notation and Semantics Cleanup Cleanup B1 B1 B1 B1 A1 A2 A1 A2 Synchronation bar:表示用來強調 (Complex Transition),可以有多個輸入進入一個superstate 、最後結束後一起輸出 Examples: Setup Setup

  11. Review examples Remote Control On() OFF ON Off() Play() Stop() Play() Stop() On() Off() CD Player On() Play() OFF On/Stop On/Play Off() Stop() Off./Stop() Transition, message

  12. Review examples Install software Restart() Restart OS OS running Create() ^Self.Restart() Start Install shield H [Alternative=continue] [alternative=try again] Out of memory() Disk Error() entry/Ask install question do/Install software Install Disk error entry/Fix disk do/Show question dialog do/Ask alternative Memory low entry/Show question dialog do/Ask alternative [Alternative=stop] [alternative=stop] Start,End,Transition,Component,History

  13. Review examples Idle TooCold(desired Temp) Toohot(desired Temp) atTemp atTemp Heating Activating Toohot(desired Temp) Cooling Ready / turnON() active TooCold(desired Temp) States

  14. Review examples Message : ‘<’ string ‘>’ string ‘;’ Put(c) [c==‘;’] / return true Put(c) [c==‘<’] waiting Put(c) [c==‘>’] GettingToken GettingBody Put(c) [c /=‘<’] / return false Put(c) [c /=‘>’] /token.append(c);return false Put(c) [c /=‘;’] /token.append(c); return false Modeling Reactive Objects

  15. Review examples Receiving ringing Idle headerOK selecting processing checkSumOK hangUp printing Transmitting sendFax Entry / pickUp Exit / disconnect Error/ print report State Diagram

More Related