Holarch
कोर्स के अध्याय

प्रशिक्षण · ट्रैक 9. SysML v2 की मूल बातें · 8 में से अध्याय 9.3

9.3 एक्शन और फ़्लो 4:31

फ़ंक्शनों और एक ड्राइव साइकिल को एक्शन के रूप में लिखें, और उन्हें Action Flow View और FFBD के रूप में देखें।

Holarch 2.22 दिखाता है।

आप क्या सीखेंगे

  • इनपुट और आउटपुट पैरामीटर और छोटे नाम के रूप में फ़ंक्शन नंबर के साथ एक action परिभाषित करें
  • fork, join, succession और item flow के साथ एक action लिखें
  • `perform` से Action Flow View में स्विम लेन पाएं
  • फ़ंक्शनल विश्लेषण में शीर्ष-स्तरीय फ़ंक्शन चुनें
  • FFBD में किसी action के चरण बनाएं और उन्हें टेक्स्ट में खोजें

एक छोटे Hybrid Car प्रोजेक्ट पर SysML v2 ट्यूटोरियल Actions and Flows का पालन करते हुए Holarch में SysML v2 actions लिखें: पैरामीटर और छोटे नामों वाली action परिभाषाएं, fork, flow और join वाला एक ड्राइव साइकिल, perform से स्विम लेन वाला Action Flow View, मॉडल पर फ़ंक्शनल विश्लेषण, और FFBD में बनाए गए चरण जिन्हें Holarch टेक्स्ट में लिखता है। SysML, Object Management Group, Inc. का पंजीकृत ट्रेडमार्क है।

प्रोजेक्ट फ़ाइलें

वीडियो holarch.app से चलता है; गोपनीयता नीति देखें।

अभ्यास

यह स्वयं Holarch में, Hybrid Car डेमो प्रोजेक्ट (SysML v2) पर करें।

  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 दिखाता है, और आप उस part का नाम बता सकते हैं जिसकी लेन में 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 item ले जाता है, और अपने आप चरणों को क्रम नहीं देता।

  3. Action Flow View की स्विम लेन कहाँ से आती हैं?

    perform से: हर part जो कोई चरण करता है, जैसे 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.