Holarch
과정의 장

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

9.8 변형과 구성 3:42

변형 지점과 규칙이 있는 제품 라인, 그리고 편집기가 검사하는 구성을 작성합니다.

Holarch 2.22 화면입니다.

← 9.7 제약 조건과 계산 · 모든 장

학습 내용

  • 변형이 있는 변형 정의를 작성하고 제품 라인의 변형 지점으로 사용하기
  • assert constraint로 제품 라인에 규칙 추가하기
  • 지점마다 변형 하나를 선택하는 구성을 만들고 판정 읽기
  • 자체 메타데이터 키워드를 정의하고 `#`으로 적용하기
  • 모델을 하나의 구성으로 보기

Hybrid Car라는 작은 프로젝트에서 SysML v2 튜토리얼 Variants and Configurations를 따라 Holarch에서 SysML v2 제품 라인을 작성합니다. Holarch의 가변성 패키지, 변형이 있는 변형 정의, 변형 지점과 단언이 있는 제품 라인, 편집기가 검사하는 구성, 메타데이터로 정의한 자체 키워드, 제품 라인의 일반 뷰를 다룹니다. SysML은 Object Management Group, Inc.의 등록 상표입니다.

프로젝트 파일

  • 완성 프로젝트 (.holarch.json; 프로젝트 관리 → 프로젝트 파일 ▾ → 프로젝트 가져오기 (.json)…)

동영상은 holarch.app에서 재생됩니다. 개인정보 처리방침을 참조하십시오.

실습

Hybrid Car 데모 프로젝트(SysML v2)에서 Holarch로 직접 해 보십시오.

  1. Hybrid Car 데모 프로젝트를 열고(필요하면 만드십시오: 프로젝트 관리 → 프로젝트 파일 ▾ → 새 데모 프로젝트 → Hybrid Car (SysML v2)), 모델 → 편집기와 패키지 Vehicles를 엽니다. 이 패키지는 이미 HolarchVariability를 가져옵니다.
  2. part def CarLine에서 charger 변형 뒤에 variation part rims : Wheel { variant part steelRims : Wheel; variant part alloyRims : Wheel { attribute :>> mass = 18 [kg]; } }를 추가합니다. 편집기는 세 구성이 아직 rims를 선택하지 않았다고 알려 줍니다.
  3. wallboxNeedsLargePack 뒤에 규칙 assert constraint alloyNeedsLargePack { rims == rims::alloyRims implies pack == BatteryPack::largePack }를 추가합니다.
  4. 모델 → 브라우저를 열고 selfChargingHybrid를 선택합니다. 속성 패널의 구성 섹션에서 rims에 steelRims를 선택하고, plugInHybrid와 longRangeHybrid에는 alloyRims를 선택합니다. 그런 다음 selfChargingHybrid에 alloyRims를 시도해 판정을 읽고 ⌘Z / Ctrl+Z를 누릅니다.
  5. CarLine의 행 메뉴(⋯)를 열고 새 구성…을 선택합니다. 이름을 cityHybrid로 지정하고, standardPack, noCharger, steelRims를 선택한 다음, 판정이 유효인지 확인하고 만들기를 클릭합니다.
  6. 상단 표시줄의 보기 기준 ▾을 클릭하고 cityHybrid를 선택한 다음, 다이어그램 목록에서 뷰 carLineVariants를 엽니다. 선택하지 않은 변형은 숨겨집니다.

속성 패널의 CarLine 제품 라인 섹션에 모두 유효인 구성 네 개와 규칙 alloyNeedsLargePack이 나열되면 완료입니다.

스스로 확인

  1. variation part def BatteryPack { … }과 variation part charger : Component { … }의 차이는 무엇입니까?
  2. plugInHybrid가 BatteryPack::standardPack과 charger::wallbox를 선택합니다. 어떻게 되며, 그 이유는 무엇입니까?
  3. 구성이 아직 모든 지점에 대해 변형을 선택하지 않았습니다. 판정은 무엇입니까?
  4. metadata def <safetyCritical> SafetyCritical은 무엇을 쓸 수 있게 하며, 다른 SysML v2 도구는 이를 어떻게 봅니까?
답 보기
  1. variation part def BatteryPack { … }과 variation part charger : Component { … }의 차이는 무엇입니까?

    첫 번째는 변형 정의로, 재사용 가능한 선택지 집합입니다. part pack : BatteryPack;처럼 이것으로 타입이 지정된 사용이 변형 지점입니다. 두 번째는 변형 사용으로, 한 설계 안에 선언된 지점입니다.

  2. plugInHybrid가 BatteryPack::standardPack과 charger::wallbox를 선택합니다. 어떻게 되며, 그 이유는 무엇입니까?

    규칙 wallboxNeedsLargePack이 위반됩니다. 이 규칙은 wallbox가 대용량 팩을 함의한다고 말합니다. 판정은 규칙의 이름을 밝히고, 편집기는 실패한 단언을 보고합니다.

  3. 구성이 아직 모든 지점에 대해 변형을 선택하지 않았습니다. 판정은 무엇입니까?

    불완전이며, 미결 지점을 밝힙니다. 지점에 선택이 없는 동안 그에 대한 규칙은 충족되지도 위반되지도 않습니다.

  4. metadata def <safetyCritical> SafetyCritical은 무엇을 쓸 수 있게 하며, 다른 SysML v2 도구는 이를 어떻게 봅니까?

    짧은 이름이 #safetyCritical part controller : Controller;처럼 키워드가 됩니다. 일반적인 메타데이터 사용이므로, 다른 SysML v2 도구는 이를 파트의 메타데이터로 봅니다.

더 읽어 보기

대본

대본 보기 (내레이션과 화면 내용)

Introduction

Chapter eight: variants and configurations. A product line offers choices, and a configuration picks one variant for each choice.

In this chapter you write a variation with variants, a product line with a rule, configurations the Editor checks, and a keyword of your own.

Start the tutorial

Start the tutorial Variants and Configurations from Project Files, Start a Tutorial. Its starter project holds the components, the car and the powertrain.

On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Variants and Configurations → Start; Model → Editor.

Variations

Holarch's variability package lets the Editor check configurations. Import it after the other imports.

On screen: After the imports: private import HolarchVariability::*;

A variation lists the choices offered. Before the powertrain, write the battery pack variation: a standard pack and a large pack, each with its own capacity, and the large one with its own mass.

On screen: After Car: variation part def BatteryPack with two variants.

The product line

Below it, the car line. Its pack is typed by the variation, its charger is a variation point with two variants, and an assertion rules out the wallbox with the standard pack.

On screen: Below BatteryPack: part def CarLine :> Car with pack, charger and the assertion.

Configurations

A configuration is a part of the car line, marked Holarch Configuration. Until it chooses a variant for each point, the Editor notes the points still open.

On screen: Below CarLine: part plugInHybrid : CarLine { @HolarchConfiguration; }

Inside the plug-in hybrid, choose the standard pack and the wallbox. The assertion fails: the wallbox needs the large pack.

On screen: In plugInHybrid: pack = BatteryPack::standardPack; charger = charger::wallbox; the assertion error.

Choose the large pack instead, and the configuration checks.

On screen: standardPack → largePack; No problems.

Add a second configuration: a self-charging hybrid, with the standard pack and no charger.

On screen: Below plugInHybrid: part selfChargingHybrid : CarLine.

A keyword of your own

You can also define keywords of your own. At the end of the package, add a metadata definition. Its short name, safety critical, becomes a keyword.

On screen: After Powertrain: metadata def <safetyCritical> SafetyCritical.

In the powertrain, put the keyword before the controller, after a number sign. Other SysML v2 tools see it as ordinary metadata.

On screen: In Powertrain: #safetyCritical part controller : Controller;

The General View

Open Architecture, then General Views, and click New Diagram. Keep General View, choose the Vehicles package under Shows, and click Create.

On screen: Architecture → General Views → + New Diagram; Shows: Vehicles; Create.

The battery pack is marked variation in its heading.

On screen: BatteryPack: «variation part def».

Recap

Every step is ticked off. Click Mark as Done.

On screen: Step panel → Mark as Done.

Let's recap. You imported Holarch's variability package, wrote a variation with variants and a product line with a rule, built configurations that the Editor checks, and defined a keyword of your own.

That completes SysML v2 Fundamentals.