printStatisticsToLogFile impure function
Requirements.Internal.printStatisticsToLogFile
ยท source
Print the violation statistics of one requirement to the log file
Extends Modelica.Icons.Function
Appends the violation statistics of one requirement to the log file as one line
Statistics,<observation>,<requirement>,<n>,<total>,<fraction>,<longest>,<longest from>,<worst>,<worst at>,<minDuration>,<mergeGap>
with the Real values written with 10 significant digits, and the worst margin and its instant left empty if
hasMargin = false. If a line starting with the same Statistics,<observation>,<requirement>,
is already in the file (from line 2 on), nothing is written: a tool may evaluate the calling when-equation
more than once at the same event instant (see
printViolationsToLogFile). The output
ok is always 1 and orders the write before the summary.
Called by StatisticsLogger. The line is read by printViolationsToOutput, which prints the section "Violation statistics" of the summary from it.
Inputs
| Name | Type | Description |
|---|---|---|
logFile input | String | Name of log file |
checkedComponentName input | String | Full path name of checked component |
requirementName input | String | Full path name of requirement model |
nViolations input | Integer | Number of violation episodes |
totalDuration input | SI.Time | Total time violated |
violatedFraction input | Real | Fraction of the applicable time violated |
longestDuration input | SI.Time | Longest violation episode |
tLongestStart input | SI.Time | Start of the longest violation episode |
hasMargin input | Boolean | = true, if worst and tWorst are logged |
worst input | Real | Worst margin |
tWorst input | SI.Time | Instant of the worst margin |
minDuration input | SI.Time | minDuration of the statistics (logged, so that a reader can recompute them) |
mergeGap input | SI.Time | mergeGap of the statistics (logged, so that a reader can recompute them) |
Outputs
| Name | Type | Description |
|---|---|---|
ok output | Real | Dummy variable needed for sorting |