Holarch
Rozdziały kursu

Szkolenia · Ścieżka 3. Zachowanie i architektura · Rozdział 3.2 z 6

3.2 Diagramy Action 2:55

Podziel funkcję na kroki z gałęziami równoległymi, decyzją i elementem, który wyzwala krok.

Pokazuje Holarch 1.27.

← 3.1 Funkcje i FFBD · Wszystkie rozdziały · 3.3 Alokacja →

Czego się nauczysz

  • Otwieranie funkcji jako diagramu Action i dodawanie kroków przez przeciąganie Action na linię
  • Dodawanie gałęzi równoległych i decyzji z prawdopodobieństwami gałęzi sumującymi się do 100%
  • Tworzenie elementu Input/Output, który jeden krok generuje, a inny odbiera jako wyzwalacz
  • Jak kroki na diagramie stają się elementami Action w modelu

Otwórz Rent a Bike jako diagram Action i zbuduj jego kroki na kanwie: akcje sekwencyjne, gałąź równoległą, decyzję z prawdopodobieństwami gałęzi oraz element wejścia/wyjścia, który jeden krok wytwarza, a inny odbiera.

Pliki projektu

  • Projekt początkowy (.holarch.json; Zarządzaj projektami → Pliki projektu ▾ → Importuj projekt (.json)…)
  • Projekt ukończony (.holarch.json; Zarządzaj projektami → Pliki projektu ▾ → Importuj projekt (.json)…)

Film jest odtwarzany z holarch.app; zobacz Politykę prywatności.

Ćwiczenie

Wykonaj to samodzielnie w Holarch, w projekcie demonstracyjnym CubeSat EO-1.

  1. Otwórz swój projekt demonstracyjny EO-1 lub go utwórz: Zarządzaj projektami → Pliki projektu ▾ → Nowy projekt demonstracyjny → CubeSat (inżynieria systemów z przewodnikiem).
  2. W Bazie danych zaznacz F10 Enter Safe Mode i wybierz Otwórz w ▾ → Diagram Action.
  3. Przeciągnij Działanie z panelu Dodaj na linię i nazwij go Detect Undervoltage. Następnie przeciągnij za nim na linię Parallel, z Shed Payload Loads na jednej gałęzi i Point Arrays to Sun na drugiej.
  4. Przeciągnij Lub na linię za Parallel i nazwij go Battery recovered?. W inspektorze ustaw prawdopodobieństwa gałęzi na 80 i 20, a na pierwszej gałęzi umieść Resume Nominal Mode, na drugiej zaś Keep Charging.
  5. Przeciągnij Input/Output na Detect Undervoltage i nazwij go Undervoltage Flag. Przeciągnij uchwyt pod I/O na Shed Payload Loads i wybierz Input (wyzwalacz).

Gotowe, gdy diagram F10 pokazuje pięć kroków, gałęzie równoległe, węzeł Lub z sumą 100% oraz Undervoltage Flag przekazywany z Detect Undervoltage do Shed Payload Loads.

Sprawdź się

  1. Co dodaje do modelu upuszczenie Action na linię?
  2. Czym różni się wejście wyzwalające od wejścia opcjonalnego?
  3. Dlaczego prawdopodobieństwa gałęzi węzła Lub muszą sumować się do 100%?
Pokaż odpowiedzi
  1. Co dodaje do modelu upuszczenie Action na linię?

    Nowy element Action, zdekomponowany pod funkcją, do której należy diagram, w tym miejscu jej przepływu. Pojawia się w Bazie danych i w każdym widoku, który go pokazuje.

  2. Czym różni się wejście wyzwalające od wejścia opcjonalnego?

    Krok z wejściem wyzwalającym nie rozpoczyna się, dopóki nie nadejdzie dany element. Wejście opcjonalne jest odbierane, ale nie wstrzymuje kroku.

  3. Dlaczego prawdopodobieństwa gałęzi węzła Lub muszą sumować się do 100%?

    Symulator wybiera gałąź według jej prawdopodobieństwa. Jeśli liczby nie sumują się do 100%, inspektor ostrzega. Jeśli prawdopodobieństwa są nieznane, wybierz Brak: Symulator zapyta wtedy w trakcie przebiegu, a Monte Carlo użyje równych prawdopodobieństw.

Więcej informacji

Transkrypcja

Pokaż transkrypcję (narracja i to, co widać na ekranie)

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.