ResponseTrace

class ResponseTrace @JvmOverloads constructor(theResponse: Response, val pathToFile: Path = theResponse.myModel.outputDirectory.outDir.resolve( theResponse.name.replace(':', '_') + "_Trace")) : ModelElementObserver(source)

Provides the ability to trace the values of a response during replications.

Parameters

theResponse

the response to trace

pathToFile

the path to the file to store the trace

Constructors

Link copied to clipboard
constructor(theResponse: Response, pathToFile: Path = theResponse.myModel.outputDirectory.outDir.resolve( theResponse.name.replace(':', '_') + "_Trace"))
constructor(theResponse: ResponseCIfc, pathToFile: Path = (theResponse as Response).myModel.outputDirectory.outDir.resolve( theResponse.name.replace(':', '_') + "_Trace"))

Properties

Link copied to clipboard

true when the traced response is a TWResponse (time-weighted, step-function semantics); false for observation-based Response variables.

Link copied to clipboard

The maximum number of observations to collect across all replications. Once the maximum is reached no further collection occurs.

Link copied to clipboard

The maximum number of observations to trace within each replication. Once the maximum is reached no further collection occurs within the replication.

Link copied to clipboard

The maximum number of replications to include in the trace. Once the maximum is reached no further replications are traced.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the distinct replication numbers present in the trace, in ascending order. Replications that were not recorded (e.g. because maxNumReplications was reached) are not included.

Functions

Link copied to clipboard
protected open override fun afterReplication(modelElement: ModelElement)
Link copied to clipboard
Link copied to clipboard
fun asDataFrame(): AnyFrame
Link copied to clipboard
Link copied to clipboard
fun ResponseTrace.toReport(title: String = name, repNums: List<Int> = replicationNumbers.take(1), startTime: Double = 0.0, endTime: Double = Double.MAX_VALUE, block: ReportBuilder.() -> Unit = { responseTrace(this@toReport, repNums, startTime, endTime) }): ReportNode.Document
Link copied to clipboard
fun traceDataMap(repNum: Double, time: Double = Double.MAX_VALUE): Map<String, DoubleArray>

Returns a map that has the times and values for the provided replication repNum up to and including the time. The default value of time is Double.MAX_VALUE, which will result in all values for the replication. Element "times" holds the times that the variable changed Element "values" holds the values associated with each time change.

fun traceDataMap(repNum: Int, startTime: Double = 0.0, endTime: Double = Double.MAX_VALUE): Map<String, DoubleArray>

Returns a map containing the times and values for replication repNum within the time window [startTime, endTime].

Link copied to clipboard
fun traceDataMaps(repNums: List<Int> = replicationNumbers, startTime: Double = 0.0, endTime: Double = Double.MAX_VALUE): Map<Int, Map<String, DoubleArray>>

Returns a map of replication number → trace data map for each replication in repNums over the time window [startTime, endTime].

Link copied to clipboard
protected open override fun update(modelElement: ModelElement)