PrintViolations model
Requirements.Verify.PrintViolations
ยท source
Print violated, untested and satisfied requirements at end of simulation (drag in top level of your model)
Block PrintViolations has to be dragged in the top-level of the model, where components of library Requirements are used. This block provides the file name, to which the Requirement blocks write their status at the end of the simulation (whether a Requirement is Violated, Untested or Satisfied, and in how many attempts, i.e. phases in which its property was applicable). Furthermore, the PrintViolations block reads this log-file at the end of the simulation and prints a summary to the output window.
The verdict is taken and printed when terminal() becomes true. A tool that does not
support terminal() (Modelon Impact evaluates it to false) never prints it.
For such a tool, set useEvaluationTime = true and evaluationTime to the instant
the verdict shall be taken at, normally the simulation stop time (both on the Advanced tab). Every
example of this library sets evaluationTime to its StopTime, so that it prints in either
kind of tool once useEvaluationTime is switched on; with the default
useEvaluationTime = false the parameter has no effect.
A tool may evaluate the when-equations that take the verdict more than once at the same event instant (Modelon Impact does). Each requirement writes its line to the log file only once, and the summary is printed only once per run: the HTML report is removed at initialization, and printing stops as soon as the report of this run exists.
Revisions
| Date | Description |
|---|---|
| Sept. 14, 2026 | Parameters useEvaluationTime and evaluationTime added: opt-in verdict at a fixed instant for tools without terminal() (H. Tummescheit, Model Based Innovation LLC) |
| Oct. 16, 2026 | The verdict is printed once in a tool that evaluates its when-equations twice at the event (Modelon Impact printed every requirement twice): the HTML report of an earlier run is removed at initialization and the summary is not printed again once the report exists; the log file holds one line per requirement (H. Tummescheit, Model Based Innovation LLC) |
Parameters
| Name | Type | Description |
|---|---|---|
logFile parameter | String | Name of log file (default = <root name>_log.txt) |
htmlFile parameter | String | Name of html log file (default = <root name>_log.html) |
useEvaluationTime parameter | Boolean | = true: take the verdict at evaluationTime instead of at terminal() (tools without terminal()) |
evaluationTime parameter | SI.Time | Instant the verdict is taken at when useEvaluationTime = true |
printViolated parameter | Boolean | = true, if violated requirements shall be printed |
printUntested parameter | Boolean | = true, if untested requirements shall be printed |
printSatisfied parameter | Boolean | = true, if satisfied requirements shall be printed |
Outputs
| Name | Type | Description |
|---|---|---|
satisfaction output | Real | Satisfaction of all requirements in % (0% ... 100%) |
Components and variables
| Name | Type | Description |
|---|---|---|
sortingPort | Requirements.Internal.SortingPort | Dummy connector to enforce that printing to and reading from log file is performed in the correct order; do not connect to it) |