} A time window.
   * @param {!Array.<!{start: number, end: number, weight: number}>} A list of
   *        weighted tasks. The weight of a task must be between 0.0 and 1.0.
   * @returns {number}
   */
  function weightedExpectedQueueingTime(window, weightedTasks) {
    let result = 0;
    for (const task of weightedTasks) {
      result += contributionToEQT(window, task) * task.weight;
    }
    return result;
  }

  /**
   * Returns expected queueing time for the given time window and
   * the given set 