code: function addResourceToMap(map, def, start) {
      var sched = JSON.parse(JSON.stringify(def.available || defaultSched)),
          nextFn = schedule.memoizedRangeFn(later.schedule(sched).nextRange);
  
      map[def.id] = { schedule: sched, next: nextFn, nextAvail: nextFn(start) };
    }
docs: Adds a resource to the resource map.