Main Content

Specify Row Type in Requirements Table Blocks

Since R2022a

You can use the Requirements Table block to define the row type of your requirements and assumptions. When designing your model, you may need to define rows that have several preconditions. For example, you may have a requirement where only one precondition must be satisfied, or each of the preconditions must be simultaneously satisfied. You may also want to define the behavior for a requirement if none of the sibling requirements are met. The Requirements Table block allows you to construct these row types using semantic rows.

You can use the Requirements Table block to create these row types:

  • Normal — A requirement or assumption row with all available properties.

  • Any Child Active — A semantic row that executes when one of its child preconditions is satisfied.

  • All Children Active — A semantic row that executes when all of its child preconditions are satisfied.

  • Default Requirement — A semantic row that executes when none of the preconditions of its siblings are met. You can only create default rows for requirements. You cannot create default assumption rows.

For more information on creating child rows, see Establish Hierarchy in Requirements Table Blocks.

Add Normal Rows

When you add a requirement or assumption to a Requirements Table block and do not specify a semantic row you create a normal row.

To add a normal requirement row, open the block and select the Requirements tab in the block. Then, in the Table tab of the toolstrip, in the Rows section, click Add Requirement.

To add a normal assumption row, select the Assumption tab. Then, in the Table tab, in the Rows section, click Add Assumption.

When you select a row index before adding a new requirement or assumption, the new row is inserted at the same level of hierarchy as the selected row.

Add Any Child Active Rows

To add a semantic requirement where only one child precondition must be satisfied before the parent requirement executes, select the Requirements tab in the block. Then, in the Table tab of the toolstrip, in the Rows section, click Add Requirement > Add Any Child Active. The table inserts the semantic requirement below the last requirement. If you select the row index of a requirement before adding the semantic requirement, the table inserts the semantic requirement below the selected row.

You can perform the same task in the Assumptions tab of the block by clicking Add Assumption > Add Any Child Active. The table inserts the semantic assumption row after the last assumption row. If you select the row index of an assumption before adding the semantic row, the table inserts the new semantic row below the selected assumption row.

You can specify the duration in the parent or in individual children for a requirement. For more information on the duration, see Using the Duration Column. If you specify the duration in a child, the duration applies only to the child. If you specify the duration for the parent, the block checks the duration only if the semantic is satisfied. See Define Formal Requirements with a Duration.

Add All Children Active Rows

To add a semantic requirement that executes only if each of the child requirement preconditions are satisfied, select the Requirements tab. Then, in the Table tab, in the Rows section, click Add Requirement > Add All Children Active. The table inserts the semantic requirement below the last requirement. If you select the row index of a requirement before adding the semantic requirement, the table inserts the semantic requirement below the selected row.

You can perform the same task in the Assumptions tab of the block by clicking Add Assumption > Add All Children Active. The table inserts the semantic assumption row after the last assumption row. If you select the row index of an assumption before adding the semantic row, the table inserts the new semantic row below the selected assumption row.

You can specify the duration in the parent or in individual children for a requirement. For more information on the duration, see Using the Duration Column. If you specify the duration in a child, the duration applies only to the child. If you specify the duration for the parent, the block checks the duration only if the semantic is satisfied. See Define Formal Requirements with a Duration.

Add Default Requirements

If you want to define behavior that occurs if none of the sibling requirements are met, include a default requirement. Click the Requirements tab. Then, click the index of the sibling requirement and, in the Rows section of the toolstrip, click Add Requirement > Add Default.

You can specify multiple default requirements in a table, or one for each group of siblings. For example, this table has two requirements that each contain two child requirements and a default requirement. The default requirement executes only if the parent precondition is true and if the siblings are false.

The requirements table shows two sets of child requirements, each with a default requirement. The default requirements do not affect the other children models.

You can specify a prioritized or exclusive exhaustive child evaluation for default rows. For more information, see Specify Child Evaluation in Requirements Table Blocks.

Switch Between Any Child Active and All Children Active Row Types

For each kind of semantic row, the table dims cells that cannot be filled and indicates the logic used by the children in each parent. This table illustrates what each semantic requirement looks like.

This image shows an empty table with multiple line logic blank requirements of each kind.

If you want to switch the semantic row type, point to the precondition cell of the parent row. The option to switch between Any Child Active and All Children Active appears at the bottom of the cell.

The switch option appears when you hover over the parent row precondition cell of a semantic row.

Use Semantic Rows in an Example Model

This example uses a Requirements Table block with semantic requirements. The model tests two signals and adjusts the output if the model behavior meets the semantic requirement preconditions.

Open the block. The block contains two semantic requirements and a default requirement:

  • If the input u1 satisfies the precondition of the first child and the input u2 satisfies the precondition of the second child, the block sets the output y to 2.

  • Otherwise, if either the first or second preconditions for the children of the second requirement are true, then the block sets y to 1.

  • If the semantic requirement preconditions are not satisfied, the block executes the action of the default requirement and sets y to 0.

Run the model and open the Scope block to observe the block output.

See Also

|

Related Topics