Chapitres du cours
Formation · Parcours 3. Comportement et architecture · Chapitre 3.2 sur 6
3.2 Diagrammes d'Action 2:55
Décomposer une fonction en étapes avec des branches parallèles, une décision et l'élément qui déclenche une étape.
Montre Holarch 1.27.
Ce que vous allez apprendre
- Ouvrir une fonction en diagramme d'Action et ajouter des étapes en faisant glisser Action sur la ligne
- Ajouter des branches parallèles et une décision dont les probabilités de branche totalisent 100 %
- Créer un Input/Output qu'une étape génère et qu'une autre reçoit comme déclencheur
- Expliquer comment les étapes du diagramme deviennent des Actions dans le modèle
Ouvrez Rent a Bike en diagramme d'Action et construisez ses étapes sur le canevas : actions en série, une branche parallèle, une décision avec des probabilités de branche, et un élément Input/Output qu'une étape produit et qu'une autre reçoit.
Fichiers de projet
- Projet de départ (.holarch.json ; Gérer les projets → Fichiers de projet ▾ → Importer un projet (.json)…)
- Projet terminé (.holarch.json ; Gérer les projets → Fichiers de projet ▾ → Importer un projet (.json)…)
La vidéo est diffusée depuis holarch.app ; voir la Politique de confidentialité.
Pratique
Faites-le vous-même dans Holarch, sur le projet de démonstration CubeSat EO-1.
- Ouvrez votre projet de démonstration EO-1, ou créez-le : Gérer les projets → Fichiers de projet ▾ → Nouveau projet de démonstration → CubeSat (ingénierie système guidée).
- Dans la Base de données, sélectionnez F10 Enter Safe Mode et choisissez Ouvrir dans ▾ → Diagramme d'Action.
- Faites glisser Action du panneau Ajouter sur la ligne et nommez-la
Detect Undervoltage. Faites ensuite glisser un Parallèle sur la ligne après elle, avecShed Payload Loadssur une branche etPoint Arrays to Sunsur l'autre. - Faites glisser un Ou sur la ligne après le Parallèle et nommez-le
Battery recovered?. Dans l'inspecteur, réglez les probabilités de branche sur 80 et 20, et placezResume Nominal Modesur la première branche etKeep Chargingsur la seconde. - Faites glisser Input/Output sur Detect Undervoltage et nommez-le
Undervoltage Flag. Faites glisser la poignée sous l'I/O sur Shed Payload Loads et choisissez Entrée (déclencheur).
C'est terminé quand le diagramme de F10 montre les cinq étapes, les branches parallèles, le OR avec un total de 100 %, et Undervoltage Flag qui passe de Detect Undervoltage à Shed Payload Loads.
Vérifiez vos connaissances
- Qu'ajoute au modèle le dépôt d'une Action sur la ligne ?
- Quelle est la différence entre une entrée déclenchante et une entrée facultative ?
- Pourquoi les probabilités de branche d'un OR doivent-elles totaliser 100 % ?
Afficher les réponses
Qu'ajoute au modèle le dépôt d'une Action sur la ligne ?
Une nouvelle Action, décomposée sous la fonction à laquelle appartient le diagramme, à cet endroit de son flux. Elle apparaît dans la Base de données et dans chaque vue qui l'affiche.
Quelle est la différence entre une entrée déclenchante et une entrée facultative ?
Une étape avec une entrée déclenchante ne démarre pas tant que cet élément n'est pas arrivé. Une entrée facultative est reçue mais ne retient pas l'étape.
Pourquoi les probabilités de branche d'un OR doivent-elles totaliser 100 % ?
Le Simulateur choisit une branche selon sa probabilité. Si les valeurs ne totalisent pas 100 %, l'inspecteur vous avertit. Si les probabilités sont inconnues, choisissez Aucune : le Simulateur pose alors la question pendant l'exécution, et Monte-Carlo utilise des probabilités égales.
Pour aller plus loin
Transcription
Afficher la transcription (narration et contenu de l'écran)
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.