Holarch
과정의 장

교육 · 트랙 9. SysML v2 기초 · 9.3장 (전체 8장)

9.3 액션과 흐름 4:31

기능과 주행 사이클을 액션으로 작성하고, Action Flow View와 FFBD로 확인합니다.

Holarch 2.22 화면입니다.

학습 내용

  • 입력 및 출력 파라미터와 짧은 이름인 기능 번호가 있는 액션 정의하기
  • fork, join, succession, 아이템 흐름이 있는 액션 작성하기
  • `perform`으로 Action Flow View에 스윔레인 만들기
  • 기능 분석에서 최상위 기능 고르기
  • FFBD에서 액션의 단계를 만들고 텍스트에서 찾기

Hybrid Car라는 작은 프로젝트에서 SysML v2 튜토리얼 Actions and Flows를 따라 Holarch에서 SysML v2 액션을 작성합니다. 파라미터와 짧은 이름이 있는 액션 정의, fork, 흐름, join이 있는 주행 사이클, perform으로 만든 스윔레인이 있는 Action Flow View, 모델에 대한 기능 분석, 그리고 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가 세 단계와 그 사이의 succession을 기록했습니다.
  5. 동작 → Action Flows와 뷰 driveCycleFlow를 엽니다. brake가 있는 레인을 찾은 다음, 그것을 그 레인에 두는 DrivenCar의 perform 줄을 찾습니다.
  6. 동작 → 기능 분석을 열고 선택…을 클릭하여 DriveCycle을 고릅니다. 기능에 짧은 이름으로 번호가 매겨졌는지 확인합니다.

편집기에서 Refuel에 파라미터, 세 단계, 그 succession이 표시되고, 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 View의 스윔레인은 어디에서 옵니까?
답 보기
  1. first start then split; fork split; then supply; then produce;에서 어떤 단계가 병렬로 실행되며, 무엇이 그것들을 다시 합칩니까?

    fork split 뒤에서 supply와 produce가 병렬 분기로 시작합니다. fork 뒤의 각 then이 분기를 시작합니다. join ready는 다음 단계로 가기 전에 둘을 모두 기다립니다.

  2. first supply then ready;와 flow of Fuel from supply.fuel to produce.fuel;의 차이는 무엇입니까?

    첫 번째는 succession으로, 단계의 시간 순서를 정합니다. 두 번째는 flow로, 한 단계의 출력 파라미터에서 다른 단계의 입력으로 Fuel 아이템을 전달하며, 그 자체로는 단계의 순서를 정하지 않습니다.

  3. Action Flow View의 스윔레인은 어디에서 옵니까?

    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.