printStatisticsToLogFile impure function

Requirements.Internal.printStatisticsToLogFile  ยท source

Icon of printStatisticsToLogFile

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

NameTypeDescription
logFile inputStringName of log file
checkedComponentName inputStringFull path name of checked component
requirementName inputStringFull path name of requirement model
nViolations inputIntegerNumber of violation episodes
totalDuration inputSI.TimeTotal time violated
violatedFraction inputRealFraction of the applicable time violated
longestDuration inputSI.TimeLongest violation episode
tLongestStart inputSI.TimeStart of the longest violation episode
hasMargin inputBoolean= true, if worst and tWorst are logged
worst inputRealWorst margin
tWorst inputSI.TimeInstant of the worst margin
minDuration inputSI.TimeminDuration of the statistics (logged, so that a reader can recompute them)
mergeGap inputSI.TimemergeGap of the statistics (logged, so that a reader can recompute them)

Outputs

NameTypeDescription
ok outputRealDummy variable needed for sorting