TWResponseFunction

class TWResponseFunction @JvmOverloads constructor(function: (Double) -> Double, observedResponse: TWResponse, name: String? = null) : TWResponse(source)

Applies the supplied function to the observed value of the time-weighted response variable and collects time-weighted statistics on the functional.

Use Case:

If you have a TWResponse tracking QueueLength, you can use a TWResponseFunction to track QueueLength > 0. This effectively tells you the probability that the queue is not empty.

val emptyStatus = TWResponseFunction({ if (it > 0) 1.0 else 0.0 }, queueLength)

Parameters

function

the function of the observed response to tally

observedResponse

the response that is being observed

name

the name of the functional response

Constructors

Link copied to clipboard
constructor(function: (Double) -> Double, observedResponse: TWResponse, name: String? = null)
constructor(function: (Double) -> Double, observedResponse: TWResponseCIfc, name: String? = null)

Functions

Link copied to clipboard
fun detach()

Detaches the functional from observing the response.