פרקי הקורס
הדרכה · מסלול 3. התנהגות וארכיטקטורה · פרק 3.2 מתוך 6
3.2 דיאגרמות Action 2:55
פירוק פונקציה לשלבים עם ענפים מקביליים, החלטה והפריט שמפעיל שלב.
מציג את Holarch 1.27.
מה תלמדו
- לפתוח פונקציה כדיאגרמת Action ולהוסיף שלבים בגרירת Action אל הקו
- להוסיף ענפים מקביליים והחלטה עם הסתברויות ענפים שמסתכמות ב-100%
- ליצור Input/Output ששלב אחד מפיק ושלב אחר מקבל כטריגר
- להסביר איך השלבים בדיאגרמה הופכים ל-Actions במודל
פותחים את Rent a Bike כדיאגרמת Action ובונים את השלבים שלה על בד הציור: פעולות טוריות, ענף מקבילי, החלטה עם הסתברויות ענפים, ופריט קלט/פלט ששלב אחד מפיק ושלב אחר מקבל.
קובצי פרויקט
- פרויקט התחלה (.holarch.json; ניהול פרויקטים ← קובצי פרויקט ▾ ← ייבוא פרויקט (.json)…)
- פרויקט גמור (.holarch.json; ניהול פרויקטים ← קובצי פרויקט ▾ ← ייבוא פרויקט (.json)…)
הסרטון מוצג מ-holarch.app; ראו את מדיניות הפרטיות.
תרגול
עשו זאת בעצמכם ב-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 מציגה את חמשת השלבים, את הענפים המקביליים, את ה-OR עם סה״כ 100%, ואת Undervoltage Flag שעובר מ-Detect Undervoltage אל Shed Payload Loads.
בדיקה עצמית
- מה מוסיפה למודל הנחת Action על הקו?
- מה ההבדל בין קלט מפעיל לקלט אופציונלי?
- למה הסתברויות הענפים של OR חייבות להסתכם ב-100%?
הצגת התשובות
מה מוסיפה למודל הנחת Action על הקו?
Action חדשה, שמפורקת תחת הפונקציה שהדיאגרמה שייכת לה, במקום הזה בזרימה שלה. היא מופיעה במסד הנתונים ובכל תצוגה שמציגה אותה.
מה ההבדל בין קלט מפעיל לקלט אופציונלי?
שלב עם קלט מפעיל אינו מתחיל עד שהפריט הזה מגיע. קלט אופציונלי מתקבל אבל אינו מעכב את השלב.
למה הסתברויות הענפים של OR חייבות להסתכם ב-100%?
הסימולטור בוחר ענף לפי ההסתברות שלו. אם המספרים אינם מסתכמים ב-100%, חלונית המאפיינים מזהירה. אם ההסתברויות אינן ידועות, בוחרים ללא: הסימולטור שואל אז במהלך הריצה, ו-Monte Carlo משתמש בהסתברויות שוות.
קריאה נוספת
תמליל
הצגת התמליל (הקריינות ומה שמוצג על המסך)
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.