 window.
   *
   * @param {!tr.b.math.Range} 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 contributionToEQT(window, task) {
    const startInWindow = Math.max(window.min, task.start);
    const endInWindow = Math.min(window.max, task.end);
    const durationInWindow = endInWindow - startInWindow;
    if (durationInWindow <= 0) return 0;
    co