課程章節
培訓 · 第 3 單元:行為與架構 · 第 3.2 章,共 6 章
3.2 Action 圖 2:55
將功能拆解為步驟,包含平行分支、決策,以及觸發某個步驟的項目。
展示 Holarch 1.27。
您將學到
- 以 Action 圖開啟功能,並將 Action 拖曳到線上以新增步驟
- 新增平行分支,以及分支機率合計為 100% 的決策
- 建立一個由某步驟產生、另一步驟作為觸發條件接收的 Input/Output
- 說明圖上的步驟如何成為模型中的 Action
以 Action 圖開啟 Rent a Bike,並在畫布上建立其步驟:循序動作、平行分支、帶分支機率的決策,以及由某步驟產生、另一步驟接收的輸入/輸出項目。
練習
在 Holarch 中於 CubeSat EO-1 示範專案上親自操作。
- 開啟您的 EO-1 示範專案,或建立它:管理專案 → 專案檔案 ▾ → 新增示範專案 → CubeSat(引導式系統工程)。
- 在資料庫中選取 F10 Enter Safe Mode,然後選擇開啟方式 ▾ → Action 圖。
- 從新增面板將 動作 拖曳到線上,並將其命名為
Detect Undervoltage。接著在其後將一個 Parallel 拖曳到線上,一個分支放Shed Payload Loads,另一個分支放Point Arrays to Sun。 - 在 Parallel 之後將一個 或 拖曳到線上,並將其命名為
Battery recovered?。在屬性面板中,將分支機率設為 80 與 20,並在第一個分支放Resume Nominal Mode,第二個分支放Keep Charging。 - 將 Input/Output 拖曳到 Detect Undervoltage 上,並將其命名為
Undervoltage Flag。將 I/O 下方的控點拖曳到 Shed Payload Loads 上,然後選擇 Input(觸發程序)。
當 F10 的圖顯示五個步驟、平行分支、總計 100% 的 OR,以及 Undervoltage Flag 從 Detect Undervoltage 傳遞到 Shed Payload Loads 時,即完成。
自我檢查
- 將 Action 放到線上,會為模型新增什麼?
- 觸發輸入與選用輸入有什麼不同?
- 為什麼 OR 的分支機率必須合計為 100%?
顯示答案
將 Action 放到線上,會為模型新增什麼?
一個新的 Action,分解於該圖所屬的功能之下,位於其流程中的該位置。它會出現在資料庫中,以及每個顯示它的檢視上。
觸發輸入與選用輸入有什麼不同?
具有觸發輸入的步驟,要等到該項目抵達後才會開始。選用輸入會被接收,但不會阻擋該步驟。
為什麼 OR 的分支機率必須合計為 100%?
模擬器依機率選擇分支。如果數字合計不是 100%,屬性面板會發出警告。如果機率未知,請選擇「無」:模擬器會在執行期間詢問,蒙地卡羅則使用相等的機率。
延伸閱讀
文字稿
顯示文字稿 (旁白與畫面內容)
Introduction
Welcome back. This chapter takes one function, Rent a Bike, and draws what happens inside it, step by step.
You will build an action diagram on the canvas, from the Add panel.
The canvas
Open the Database, select Rent a Bike, and choose Open in, then Action Diagram. The canvas starts with a start, an end, and the line between them. The Add panel on the left holds the building blocks.
On screen: Database → F.1 → Open in ▾ → Action Diagram.
Steps in order
Drag an Action onto the line, and name it Identify Rider. The rider taps a card or a phone at the kiosk.
On screen: Action → line → Identify Rider.
The next step drops onto the line after it: Check Account. The back office confirms the rider can rent. Each new step is joined to the last for you.
On screen: Action → Check Account.
Parallel branches and a decision
Two things happen at once next: the bay unlocks, and the kiosk shows the rider which bay it is. Drag a Parallel onto the line. It opens two branches that start together and join when both finish.
On screen: Parallel → line.
Drop an action onto each branch: Unlock Bay on the first, Show Bay Number on the second.
On screen: An action on each branch.
Then a decision: does the rider take the bike within thirty seconds? Drag an Or onto the line, and put the question in its name.
On screen: Or → line → name.
Each branch of a decision has a probability, for simulation later. Most riders take the bike: ninety-five percent for yes, five for no. The panel checks that they add up to one hundred.
On screen: Branch probabilities 95 / 5.
On the yes branch the rental starts: Start Rental. On the no branch the bay locks again: Relock Bay.
On screen: An action on each branch.
Inputs and outputs
Steps also pass items to each other. Drag an Input/Output onto Check Account: the step now produces it. Name it Unlock Code, the approval the back office sends.
On screen: I/O → Check Account → Unlock Code.
Unlock Bay receives the code, and receiving it is what starts that step. Drag from the handle on Unlock Code onto Unlock Bay, and choose Input, trigger. An optional input would not start the step.
On screen: Handle on Unlock Code → Unlock Bay → Input (trigger).
The diagram is part of the model. The steps are actions under Rent a Bike, and the item and its links appear in the Database and on every view that shows them.
On screen: The completed action diagram.
Recap
Let's recap. You opened a function as an action diagram, dropped steps onto the line, added parallel branches and a decision with probabilities, and connected an item that triggers a step.
Next, you decide which part of the dock performs each function: allocation.