Holarch
コースのチャプター

トレーニング · トラック 9. SysML v2 の基礎 · チャプター 9.3(全 8 チャプター)

9.3 アクションとフロー 4:31

機能とドライブサイクルをアクションとして記述し、Action Flow ビューと FFBD で確認します。

Holarch 2.22 の画面です。

学習内容

  • 入力パラメーターと出力パラメーター、短縮名としての機能番号を持つアクションを定義する
  • フォーク、ジョイン、サクセッション、アイテムフローを含むアクションを記述する
  • `perform` から Action Flow ビューのスイムレーンを得る
  • 機能分析で最上位の機能を選ぶ
  • FFBD でアクションのステップを作成し、テキスト内で見つける

小さな Hybrid Car プロジェクトで SysML v2 チュートリアル「Actions and Flows」に沿って、Holarch で SysML v2 のアクションを記述します。パラメーターと短縮名を持つアクション定義、フォーク・フロー・ジョインを含むドライブサイクル、perform によるスイムレーンを持つ Action Flow ビュー、モデルでの機能分析、そして FFBD で作成し Holarch がテキストに書き込むステップを扱います。SysML は Object Management Group, Inc. の登録商標です。

プロジェクトファイル

  • 完成したプロジェクト (.holarch.json。プロジェクトを管理 → プロジェクトファイル ▾ → プロジェクトをインポート (.json)…)

動画は holarch.app から再生されます。プライバシーポリシーをご覧ください。

演習

Hybrid Car デモプロジェクト(SysML v2)を使って、Holarch で実際に操作します。

  1. Hybrid Car デモプロジェクトを開き(必要に応じて作成します:プロジェクトを管理 → プロジェクトファイル ▾ → 新しいデモプロジェクト → Hybrid Car (SysML v2))、モデル → エディターとパッケージ VehicleBehavior を開きます。
  2. action def <'F.3'> DriveWheels の下に、action def <'F.4'> Refuel { in attribute fuelDemand : Real; out item fuel : Fuel; } を追加します。
  3. 振る舞い → FFBD を開き、+ 新しいダイアグラムをクリックして Refuel を選び、作成をクリックします。追加パネルで Open Filler Door と入力して Enter キーを押し、続いて Pump Fuel と Close Filler Door を入力します。
  4. モデル → エディターを開いて Refuel を見つけます。FFBD が 3 つのステップとその間のサクセッションを書き込んでいます。
  5. 振る舞い → Action Flows とビュー driveCycleFlow を開きます。brake を含むレーンを見つけ、次に DrivenCar 内で、それをそこに置いている perform の行を見つけます。
  6. 振る舞い → 機能分析を開き、選択…をクリックして DriveCycle を選びます。その機能が短縮名で番号付けされていることを確認します。

エディターで Refuel にパラメーター、3 つのステップ、そのサクセッションが表示され、brake を含むレーンのパートを答えられれば完了です。

確認問題

  1. first start then split; fork split; then supply; then produce; では、どのステップが並列に実行され、何がそれらを再び合流させますか?
  2. first supply then ready; と flow of Fuel from supply.fuel to produce.fuel; の違いは何ですか?
  3. Action Flow ビューのスイムレーンはどこから来ますか?
解答を表示
  1. first start then split; fork split; then supply; then produce; では、どのステップが並列に実行され、何がそれらを再び合流させますか?

    フォーク split の後、supply と produce が並列の分岐として始まります。フォークの後の各 then が分岐を開始します。ジョイン ready は両方を待ってから次のステップに進みます。

  2. first supply then ready; と flow of Fuel from supply.fuel to produce.fuel; の違いは何ですか?

    前者はサクセッションで、ステップを時間的に順序付けます。後者はフローで、あるステップの出力パラメーターから別のステップの入力へ Fuel アイテムを運びますが、それ自体ではステップを順序付けません。

  3. Action Flow ビューのスイムレーンはどこから来ますか?

    perform からです。part redefines tank { perform trip.supply; } のようにステップを実行する各パートが、実行するステップを含むレーンを持ちます。

関連資料

トランスクリプト

トランスクリプトを表示 (ナレーションと画面の内容)

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.