Holarch

SysML v2 Projects

Individuals, Snapshots and Time Slices

An individual is one particular thing, such as the car with serial number 1234, rather than a kind of thing. Its snapshots record it at an instant; its time slices record a period of its life.

individual part def Car_VIN1234 :> Car { snapshot atDelivery { attribute :>> mileage = 0 [km]; } timeslice firstOwner { attribute ownerName : String = "Dana Reyes"; } snapshot atService { attribute :>> mileage = 15000 [km]; } first atDelivery then atService; assert constraint mileageGrows { atDelivery.mileage <= atService.mileage } }
  • individual goes before the kind keyword (individual part def, individual item def) or stands alone (individual def Plate_77;). A usage written individual must be typed by exactly one individual definition: individual car1 : Car_VIN1234;.
  • A snapshot or timeslice belongs to the occurrence that owns it: a part, item, action or other occurrence definition or usage. It has that occurrence's features, so :>> mileage redefines the car's mileage for that instant or period. Values inside a snapshot or time slice are read there first, then from the individual, then from its definition.
  • first atDelivery then atService; orders snapshots and time slices in time; then timeslice secondOwner; does the same in one line.
  • Only occurrences can be individuals, snapshots or time slices. Attributes and enumerations are values, so the Editor reports individual or snapshot on them. A time slice inside a snapshot is reported as a warning: a snapshot lasts an instant.

In Holarch

  • Inspector: Occurrence under Features has the Individual check box and, for usages, the portion: Whole life, Time slice or Snapshot. Each change is one undo step and updates the text. For an attribute or enumeration the controls are disabled, with the reason.
  • Browser: the kind column reads as written (individual part def, snapshot, timeslice); the kind filter has Individuals. A row's ⋯ menu has New Snapshot… and New Time Slice… for occurrences.
  • General View: the header shows «individual part def», «snapshot» or «timeslice»; a box lists its snapshots and time slices in the time slices and snapshots compartment, and successions between boxes draw as dashed arrows. Right-click a box for New Snapshot… and New Time Slice…; Arrange ▾ → Arrange as Timeline lines up the snapshots and time slices shown as boxes from left to right in succession order.
  • In the Hybrid Car demo, Car_VIN1234 in Vehicles is an individual car with two snapshots, a time slice and a constraint comparing its mileage; the General View carLifeline shows them.

See also SysML v2 Basics and Supported SysML v2 Language.