Predefined Output-Sets

The simplest way to configure the output returned for a request is to select one of the predefined output-sets. Each output-set corresponds to a predefined output_config object. Here we list the available output-sets and their equivalent output_config, which actually defines the output to be returned by evaluating a model of sleep-wake and alertness dynamics.

Alternatively, if you would prefer define a custom set of outputs then the output_set field must be specified as:

{
  "output_set": "custom"
}

indicating that the provided input will include an explicit output_config field.

See the Custom Output section of the Input Fields reference for details of the output_config field.


Default

The default output returned for a predictions request. It includes sleep times and durations as well as the duration of “levels of alertness” during forced-wake intervals.

Specify With:

{
  "output_set": "default"
}

Note: as this is the default output-set for predictions requests, it is not necessary to specify this output-set explicitly, the output_set field can be omitted from input.

Equivalent Output-Config:

{
  "data_format": "json",
  "time_format": "date-time",
  "duration_format": "minutes",
  "durations": [
    {
      "interval": "simulation"
    },
    {
      "interval": "forced-wake",
      "state": "alertness-level-green"
    },
    {
      "interval": "forced-wake",
      "state": "alertness-level-yellow"
    },
    {
      "interval": "forced-wake",
      "state": "alertness-level-red"
    },
    {
      "interval": "forced-wake"
    },
    {
      "interval": "sleep"
    }
  ]
}

Default Raster

Adds a raster-plot of model’s results to the default output.

Specify With:

{
  "output_set": "default-raster"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "figure_format": "png",
  "time_format": "date-time",
  "duration_format": "minutes",
  "durations": [
    {
      "interval": "simulation"
    },
    {
      "interval": "forced-wake",
      "state": "alertness-level-green"
    },
    {
      "interval": "forced-wake",
      "state": "alertness-level-yellow"
    },
    {
      "interval": "forced-wake",
      "state": "alertness-level-red"
    },
    {
      "interval": "forced-wake"
    },
    {
      "interval": "sleep"
    }
  ],
  "figures": [
    "raster-outputs"
  ]
}

Sleep

Returns the timing (date-time strings) and duration (in minutes) of intervals of sleep.

Specify With:

{
  "output_set": "sleep"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "time_format": "date-time",
  "duration_format": "minutes",
  "durations": {
    "interval": "sleep"
  }
}

Sleep Raster

Same as for Sleep, but adds a raster plot of model predictions/recommendations, in svg format, to the output.

Specify With:

{
  "output_set": "sleep-raster"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "figure_format": "svg",
  "time_format": "date-time",
  "duration_format": "minutes",
  "durations": {
    "interval": "sleep"
  },
  "figures": [
    "raster-outputs"
  ]
}

Recommendations

Default output-set of requests for recommendations.

Specify With:

{
  "output_set": "recommendations-default"
}

Note: as this is the default output-set for recommendations requests, it is not necessary to specify this output-set explicitly.

Equivalent Output-Config:

{
  "time_format": "date-time",
  "duration_format": "minutes",
  "data_format": "json",
  "intervals": [
    "sleep"
  ]
}

Recommendations Raster

Adds a raster-plot of model output to the same json data as the default output-set returned for recommendations.

Specify With:

{
  "output_set": "recommendations-raster"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "figure_format": "png",
  "time_format": "date-time",
  "duration_format": "minutes",
  "intervals": [
    "sleep"
  ],
  "figures": [
    "raster-outputs"
  ]
}

Midnight State

Returns the value of a model’s state-variables at each local midnight in the simulated time-interval.

Specify With:

{
  "output_set": "midnight-state"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "time_format": "date-time",
  "duration_format": "minutes",
  "instant_samples": {
    "interval": "simulation",
    "measure": "state-variables",
    "instant": "midnight"
  }
}

Continuation

Intended for simplifying obtaining modified initial conditions, returns a model’s state variables at the end time of the evaluation interval.

Specify With:

{
  "output_set": "continuation"
}

Equivalent Output-Config:

{
  "time_format": "date-time",
  "duration_format": "minutes",
  "data_format": "json",
  "instant_samples": [
    {
      "interval": "simulation",
      "measure": "state-variables",
      "instant": "simulation-start"
    },
    {
      "interval": "simulation",
      "measure": "state-variables",
      "instant": "simulation-end"
    }
  ]
}

Continuation Raster

Adds a raster-plot of model output to the same json data as the continuation output-set returns.

Specify With:

{
  "output_set": "continuation-raster"
}

Equivalent Output-Config:

{
  "time_format": "date-time",
  "duration_format": "minutes",
  "data_format": "json",
  "instant_samples": [
    {
      "interval": "simulation",
      "measure": "state-variables",
      "instant": "simulation-start"
    },
    {
      "interval": "simulation",
      "measure": "state-variables",
      "instant": "simulation-end"
    }
  ],
  "figures": [
    "raster-outputs"
  ]
}



Legacy

These output-sets use the generalised configurable output introduced in /v3 to approximate the output returned by earlier versions of the API at https://www.alertnessapi.com. They are included here purely as a reference for users familiar with older versions of the API.

Note: These are considered deprecated and will be removed from future versions.


Alertness-CRC

Specify With:

{
  "output_set": "alertnessCRC-new"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "figure_format": "png",
  "time_format": "hours",
  "duration_format": "hours",
  "time_series": [
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean",
      "sampling_period": 60
    },
    {
      "interval": "simulation",
      "measure": "effective-light",
      "statistic": "value",
      "sampling_period": 1
    },
    {
      "interval": "simulation",
      "measure": "sleep",
      "statistic": "value",
      "sampling_period": 1
    }
  ],
  "interval_samples": [
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean-mean"
    }
  ],
  "intervals": [
    "sleep",
    "wake",
    "forced-wake-shift"
  ],
  "instants": {
    "interval": "simulation",
    "label": "core-body-temperature-local-minima"
  },
  "durations": {
    "interval": "simulation"
  },
  "figures": [
    "raster-outputs"
  ]
}

Scheduling New

Specify With:

{
  "output_set": "scheduling-new"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "time_format": "hours",
  "duration_format": "hours",
  "time_series": {
    "interval": "pre-post-forced-wake-shift",
    "measure": "vPVTL",
    "statistic": "mean",
    "sampling_period": 60
  },
  "instant_samples": [
    {
      "interval": "simulation",
      "measure": "state-variables",
      "instant": "midnight"
    },
    {
      "interval": "simulation",
      "measure": "circadian",
      "instant": "midnight"
    }
  ],
  "interval_samples": [
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean-mean"
    }
  ],
  "intervals": [
    "sleep",
    "wake",
    "forced-wake-shift"
  ],
  "durations": {
    "interval": "simulation"
  }
}

Scheduling Old

Specify With:

{
  "output_set": "scheduling-old"
}

Equivalent Output-Config:

{
  "data_format": "json",
  "time_format": "hours",
  "duration_format": "hours",
  "instant_samples": [
    {
      "interval": "simulation",
      "measure": "state-variables",
      "instant": "midnight"
    },
    {
      "interval": "simulation",
      "measure": "circadian",
      "instant": "midnight"
    }
  ],
  "interval_samples": [
    {
      "interval": "wake",
      "measure": "vPVTL",
      "statistic": "mean"
    },
    {
      "interval": "wake",
      "measure": "vPVTL",
      "statistic": "mean-mean"
    },
    {
      "interval": "forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean"
    },
    {
      "interval": "forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean-mean"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "measure": "vPVTL",
      "statistic": "mean-mean"
    }
  ],
  "intervals": [
    "sleep"
  ],
  "durations": [
    {
      "interval": "simulation"
    },
    {
      "interval": "wake",
      "state": "alertness-level-green"
    },
    {
      "interval": "wake",
      "state": "alertness-level-yellow"
    },
    {
      "interval": "wake",
      "state": "alertness-level-red"
    },
    {
      "interval": "forced-wake-shift",
      "state": "alertness-level-green"
    },
    {
      "interval": "forced-wake-shift",
      "state": "alertness-level-yellow"
    },
    {
      "interval": "forced-wake-shift",
      "state": "alertness-level-red"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "state": "alertness-level-green"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "state": "alertness-level-yellow"
    },
    {
      "interval": "pre-post-forced-wake-shift",
      "state": "alertness-level-red"
    }
  ]
}