Trim windowing

A windowing policy of type trim trims the temporal interval of a trial, both from the start and from the end of a specified temporal amount (e.g., 3 seconds).

The trim windowing has the following structure:

Filed
Type
Value restrictions
Is required
Default value
Description

type

string

{trim}

TRUE

the type of windowing strategy

trim

array of strings

The length of the array should be two.

Valid values should have the form of a whole number followed by either "s", "m", or "h". Additional suffix "@start" or "@end" can be added to reverse the logic

TRUE

How to trim the temporal interval of a trial to get the window. ["0s", "10m"] means trim 0 seconds from the start of the interval, 10 minutes from the end. ["0s", "1h"] means trim 0 seconds from the start, 1 hour from the end ["1m", "4m@start"] means trim 1 minute from the start to 4m after the start (a window of 3 exact minutes)

task

string

The name of a task of the workflow associated with the study

FALSE

If the field is specified, the trim offset calculation for the window will be applied from the start time of the assigned task. Otherwise, it will be calculated from the start time of the trial.

In case a windowing policy is not specified, the default windowing corresponding to trim[0s,0s] is considered.

Examples

The following fragment shows a windowing strategy of type "trim", where the time window starts 10 seconds after the beginning of the trial and ends immediately before the end of the trial:

windowing: # the temporal window in which to compute the score of a trial
  type: "trim" # type of windowing is trim
  trim: [10s, 0s]

The following fragment shows a trim windowing where the time window starts 1 minute after the beginning of the trial and ends 4 minutes from the start of the trial. In other words, this defines a fixed interval with a length of 3 minutes:

windowing:
  type: "trim"
  trim: [1m, 4m@start]

The following fragment shows a trim windowing where the time window starts 5 minutes before the end of the trial and ends 1 minute before the end. In other words, this defines a fixed interval with a length of 4 minutes:

windowing:
  type: "trim"
  trim: [5m@end, 1m@end]

The following fragment shows a trim windowing where the time window starts 5 minutes before the end of the trial and ends 10 minutes from the start.

Note: If the trial duration is shorter than 5 minutes, no windowing will take effect, and the entire trial duration will be used.

Implicit Behavior of @start and @end

Using the @start suffix for the left boundary and the @end suffix for the right boundary is supported but optional, as they are implicitly assumed.

For example, assuming a trial duration of 10 minutes, the following time windows yield the same result, selecting a window that starts 1 minute after the start and ends 1 minute before the end:

However, if the trial duration is different (e.g., 15 minutes), the expressions [1m, 1m] and [1m, 9m@start] will yield different results:

  • [1m, 1m] → Produces a 13-minute central interval.

  • [1m, 9m@start] → Still produces an 8-minute interval, as before.

Last updated

Was this helpful?