Chapitres du cours
Formation · Parcours 9. Les fondamentaux de SysML v2 · Chapitre 9.3 sur 8
9.3 Actions et flux 4:31
Écrire des fonctions et un cycle de conduite sous forme d'actions, et les voir dans une Vue de flux d'Action et un FFBD.
Montre Holarch 2.22.
Ce que vous allez apprendre
- Définir une action avec des paramètres d'entrée et de sortie et un numéro de fonction comme nom court
- Écrire une action avec un fork, un join, des successions et des flux d'items
- Obtenir des couloirs dans une Vue de flux d'Action à partir de `perform`
- Choisir la fonction de premier niveau dans Analyse fonctionnelle
- Construire les étapes d'une action dans le FFBD et les retrouver dans le texte
Écrivez des actions SysML v2 dans Holarch, en suivant le tutoriel SysML v2 Actions and Flows sur un petit projet Hybrid Car : des définitions d'action avec paramètres et noms courts, un cycle de conduite avec un fork, des flux et un join, une Vue de flux d'Action avec des couloirs issus de perform, l'Analyse fonctionnelle sur le modèle, et des étapes construites dans le FFBD que Holarch écrit dans le texte. SysML est une marque déposée d'Object Management Group, Inc.
Fichiers de projet
- 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 Hybrid Car (SysML v2).
- Ouvrez votre projet de démonstration Hybrid Car (créez-le si besoin : Gérer les projets → Fichiers de projet ▾ → Nouveau projet de démonstration → Hybrid Car (SysML v2)), ouvrez Modèle → Éditeur et le package
VehicleBehavior. - Sous
action def <'F.3'> DriveWheels, ajoutezaction def <'F.4'> Refuel { in attribute fuelDemand : Real; out item fuel : Fuel; }. - Ouvrez Comportement → FFBD, cliquez sur + Nouveau diagramme, choisissez
Refuelet cliquez sur Créer. Dans le panneau Ajouter, saisissezOpen Filler Dooret appuyez sur Entrée, puisPump FueletClose Filler Door. - Ouvrez Modèle → Éditeur et trouvez
Refuel: le FFBD a écrit ses trois étapes et les successions entre elles. - Ouvrez Comportement → Flux d'actions et la vue
driveCycleFlow. Trouvez le couloir qui contientbrake, puis la ligneperformdeDrivenCarqui l'y place. - Ouvrez Comportement → Analyse fonctionnelle, cliquez sur Choisir… et choisissez
DriveCycle. Vérifiez que ses fonctions sont numérotées par leurs noms courts.
C'est terminé quand Refuel affiche ses paramètres, trois étapes et leurs successions dans l'Éditeur, et que vous pouvez nommer la partie dont le couloir contient brake.
Vérifiez vos connaissances
- Dans
first start then split; fork split; then supply; then produce;, quelles étapes s'exécutent en parallèle, et qu'est-ce qui les réunit ? - Quelle est la différence entre
first supply then ready;etflow of Fuel from supply.fuel to produce.fuel;? - D'où viennent les couloirs d'une Vue de flux d'Action ?
Afficher les réponses
Dans
first start then split; fork split; then supply; then produce;, quelles étapes s'exécutent en parallèle, et qu'est-ce qui les réunit ?Après le fork
split,supplyetproducedémarrent comme branches parallèles ; chaquethenaprès un fork démarre une branche. Le joinreadyattend les deux avant l'étape suivante.Quelle est la différence entre
first supply then ready;etflow of Fuel from supply.fuel to produce.fuel;?La première est une succession : elle ordonne les étapes dans le temps. La seconde est un flux : elle transporte un item Fuel du paramètre de sortie d'une étape vers l'entrée d'une autre, et n'ordonne pas les étapes par elle-même.
D'où viennent les couloirs d'une Vue de flux d'Action ?
De
perform: chaque partie qui réalise une étape, commepart redefines tank { perform trip.supply; }, obtient un couloir avec les étapes qu'elle réalise.
Pour aller plus loin
Transcription
Afficher la transcription (narration et contenu de l'écran)
Introduction
Chapter three: actions and flows. Actions describe what the system does, in what order, and what passes between the steps.
In this chapter you define functions with parameters, write a drive cycle with a fork, flows and a join, see it as an Action Flow View with swim lanes, and build steps in the FFBD.
Start the tutorial
Start the tutorial Actions and Flows from Project Files, Start a Tutorial. Its starter project holds the fuel and torque items, two of the car's three functions, and the parts that will perform them.
On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Actions and Flows → Start; Model → Editor.
Functions
An action definition describes something the system does, and its parameters say what goes in and out. Below the torque item, define Supply Fuel. The short name in angle brackets, F one, is its function number.
On screen: Below item def Torque; type action def <'F.1'> SupplyFuel.
The drive cycle
Now the drive cycle, at the end of the package. Its action usages are the steps, each typed by a function. First start, then split, begins with a fork, and each then after the fork starts a parallel branch.
On screen: After DriveWheels; type action def <'F'> DriveCycle with the fork and two steps.
A flow carries an item from one step's output to another step's input. After the two steps, add a flow that carries the fuel from the supply step to the torque step.
On screen: After action produce: flow of Fuel from supply.fuel to produce.fuel;
Both branches end at a join named ready. Then the car drives the wheels, and the trip is done. A second flow carries the torque to the drive step.
On screen: After the flow: successions to the join ready, then action drive, then done; flow of torque.
The Action Flow View
Now see the drive cycle as a view. Open Behavior, then Action Flows, and click New Diagram. Keep Action Flow View, choose the drive cycle under Shows, and click Create.
On screen: Behavior → Action Flows → + New Diagram; Shows: VehicleBehavior::DriveCycle; Create.
Steps are rounded boxes, with their parameters as pins. The fork and the join are bars, and the flows are arrows between pins.
On screen: The view.
Swim lanes come from perform. Back in the Editor, at the end of the package, add a driven car. It performs the drive cycle as its trip, and its parts perform the steps.
On screen: Model → Editor; after DriveCycle: part def DrivenCar with perform.
Open the Action Flow View again. It now has a lane for each part that performs a step.
On screen: Behavior → Action Flows → the view; lanes tank, engine, transmission.
Functional Analysis and the FFBD
The same model drives Functional Analysis. Open it under Behavior, click Choose, and pick the drive cycle. Its functions are the steps, numbered by their short names.
On screen: Behavior → Functional Analysis; Choose… → DriveCycle.
Back in the Editor, at the end of the package, declare one more action: emergency shutdown. You build its steps in the FFBD.
On screen: Model → Editor; after DrivenCar: action def EmergencyShutdown;
Open Behavior, then FFBD, and click New Diagram. Type the start of emergency shutdown, pick it from the list, and click Create.
On screen: Behavior → FFBD → + New Diagram; Diagram of: EmergencyShutdown; Create.
In the Add panel, type Open Contactors and press Enter, then Cut Fuel. Each step is written into the model with its succession, one undo step each.
On screen: Add panel: Open Contactors ↵, Cut Fuel ↵.
Open the Editor and find emergency shutdown. The FFBD wrote its steps, and the successions between them.
On screen: Model → Editor: EmergencyShutdown with two steps and successions.
Recap
Every step is ticked off. Click Mark as Done.
On screen: Step panel → Mark as Done.
Let's recap. You defined functions with parameters and short names, wrote a drive cycle with a fork, flows and a join, saw it as an Action Flow View with lanes from perform, and built steps in the FFBD that Holarch wrote into the text.
Next, states and transitions describe how the car reacts to events.