You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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).