Chapter 1. Modeling the State Structure of a System
Items and Parts
- In SysML v2, objects are called items.
- The parts of a system are special items.
- A system, as a composite object, is also classified as a part since it may be a subsystem of a larger system.
Core Modeling Concepts
- Types
- classify things and may have features.
There are two kinds of types: classifiers and features. - Classifiers
- are types that classify things.
Examples: data types, item types, part types, action types. - Features
- model the relations between things.
Examples: attributes, item properties, part properties, action steps.
Types
- The set of things classified by a type is called its extent.
- Each member of its extent is an instance of the type.
- Everything is an instance of the predefined type
Anything
. - Types may have features. Consequently, not only classifiers, but also features may have features.
- A type S may specialize another type T. Then S is a subtype of T and T is a supertype of S. A subtype inherits all features of its supertypes.
Examples of Classifiers and Features
An item type definition with two attributes item def Person { attribute name : String; attribute age : Natural; } Two part type definitions part def Engine; part def Wheel;
A part type definition with four features part def Car { attribute mass : ISQ::MassValue; Three part properties part engine : Engine; part wheels[4] : Wheel; ref part driver[0..1] : Person; }
- The data type MassValue is predefined in the library package ISQ.
- wheels[4] means that the part property wheels has the multiplicity 4, implying that it has exactly 4 values.
- driver[0..1] means that this part property has at most one value.
- By default, part properties are "composite" features, representing parts/components, which cannot exist after the whole ceases to exist, unlike "referential" features.
- ref part means that this part property is not composite, but referential.
Terminology
SysML v2 comes with a superfluous jargon: calling classifiers (like data types or item types) "definitions" and calling features (like attributes or item properties) "usages", which is confusing.
Official SysML v2 Terminology | Preferrable (Classsical) Terminology |
---|---|
attribute definition | data type |
attribute usage | attribute |
item (part/port/action/etc.) definition | item (part/port/action/etc.) type |
item (part/port/etc.) usage | item (part/port/etc.) property |
action usage | action property (or action step) |
Connection Types
A connection is both a relationship between parts and a kind of part.
A connection type is an association that classifies connections between related parts.
part def Axle {...} part def Wheel {...} connection def Mounting { end [1] part mountingAxle : Axle; end [2] part mountedWheel : Wheel; }
End properties, like mountingAxle and mountedWheel, always have the multiplicity 1.
The yellow multiplicities are called cross multiplicities.
The cross multiplicity [2] of the end property mountedWheel expresses the constraint that for any instance of Axle, there are exactly two links in the extent of Mounting linking the axle to two different wheels.
Connection Properties
An axle assembly consists of one axle, two wheels and two mount connections, such that each of the two wheels is connected to the axle via a mount connection.
part def Axle {...} part def Wheel {...} connection def Mounting { end [1] part mountingAxle : Axle; end [2] part mountedWheel : Wheel; }
part def AxleAssembly { part axle : Axle; part wheels[2] : Wheel; connection mount[2] : Mounting from axle to wheels; }
The connection property mount specializes the connection type Mounting by restricting its end values to values from the corresponding part properties axle and wheels. It has exactly 2 values: one mount connection for each of the 2 wheels.
Ports and Interfaces
Ports, as values of port properties, are special objects representing connection points. The ports referenced by two port properties can be connected via an interface property for enabling transfers (e.g., of signals or physical quantities) if their types match in the sense that they have the same directed parameters, but with inverse direction.
port def MotorCtrlPort { out attribute speed : Real; out attribute dir : Integer; in errorStatus : Integer; } port def CtrlInputPort { in attribute speed : Real; in attribute dir : Integer; out errorStatus : Integer; }
part def Vehicle { part motorController { port motorCtrlPort : MotorCtrlPort; } part motor { port ctrlInputPort : CtrlInputPort; } interface motorController.motorCtrlPort to motor.ctrlInputPort; }
An interface property is a special kind of connection property for connecting ports.