Skip to content

v0.1.19

Choose a tag to compare

@github-actions github-actions released this 26 Sep 11:59
· 23 commits to main since this release
ecb2c03

Added

  • Schedule (#10): piecewise-constant, optionally periodic values over simulation time for rush hours, shifts and seasons. new Schedule(sim, { period, segments, defaultValue }), current, at(time), nextChange, hasMoreChanges, yield* waitForChange() and onChange(handler, { immediate }). Non-periodic schedules hold their last value; gaps use defaultValue or throw.
  • Resource.setCapacity(n) and a capacity getter: change staffing while the simulation runs. Growing capacity grants waiting requests immediately; shrinking never interrupts anyone, surplus units are shed as they are released. available is clamped at 0 and utilization at 1 while usage exceeds a reduced capacity.
  • The bank-tellers example staffs the counter from a schedule (opening, rush, lunch, afternoon).