Staffing that follows your events
A fair across the road, a sale, a home game, the week before a holiday. Put it on the calendar, say what it changes, and every draft, every coverage view and your AI assistant plan for it, with the reason shown.
The staffing plan says what a usual day needs. Real days are not all usual, and the days that are not are the ones that go wrong: the market across the road fills the car park by ten, the holiday week doubles the queues, the home game empties the place at seven and floods it at ten. Metraia keeps an events calendar that changes what those days need, line by line, and says why.
Put it on the calendar
An event has a name, where it happens (one site or all of them), its first and last day, the attendance expected if you know it, a few tags, and what it changes:
- “Cashiers × 1.5” for the holiday rush: every cashier line on those days needs half as many again, rounded up.
- “Bakers + 1” for the market weekend: one more on each baker line.
- “Security + 4”, “Gate staff × 2”, “Ushers − 2” for a quiet matinee: any department, any position, or every line at once.
From then on, every week drafted fills what those days need. Weeks already drafted keep their shifts until you redraft them, so a late change never moves anyone without a decision.
Calendars and forecasts from outside, kept up to date
The events that matter are often on someone else’s calendar: the arena’s home games, the league’s fixtures, the city’s festivals, a venue’s bookings. The numbers that matter are often in someone else’s system: a footfall forecast from the shopping centre’s counters, ticket sales, bookings by the hour. Metraia takes both straight from there.
- Fetched on a schedule from the calendar the venue, league or city already publishes, signing in where it needs to. Or pushed by their ticketing or booking system, so no outbound connection is needed at all.
- What each one does is set once: “home games: one more cashier on each line, two on derby nights”. Repeating events, cancellations and moved dates are all followed.
- Forecasts by the hour, as CSV or JSON from whatever system makes them, go straight to your demand scripts: “one self-checkout attendant for every 250 visitors in the busiest hour of the shift” is a few lines. A source in a shape of its own is put in order by a short sealed script.
- Never caught out by a stale calendar. Each calendar says how fresh it must be. If it stops coming, what it last brought is still used, with a note wherever it shows, or left out until it is fresh again, whichever you choose.
- Safe by design. Metraia reaches only the addresses you list, over encrypted connections, and keeps the secrets in files of their own. Everything that comes in is checked before it is used, and every fetch is logged.
Let a script work it out
Some operations know more than “busy” or “quiet”: ticket sales, bookings, a forecast of footfall. A demand script turns that into people. Scripts are short, readable functions in Rhai that look at the day (its events, their tags and attendance, the weekday) and at each line of the plan, and return how many it needs:
// One more cashier on each daytime line for every 2,000 people expected.
fn need(day, line) {
if line.position == "cashier" && day.attendance > 0 && line.start_minutes < 17 * 60 {
return line.count + day.attendance / 2000;
}
}
Scripts run in a closed engine: no clock, no randomness, no files, no network, and firm limits on how much they may compute. The same day always gives the same answer, so what you preview is exactly what the draft will do, and a script can never reach anything it should not. One that fails is passed over and reported; it never stops a week from being drafted. Managers switch scripts on and off; writing them is for whoever runs the installation, or for us, as part of making Metraia fit.
See every day, and why
- Events and demand previews any day: every line of the plan, what it usually needs, what it needs that day, and the event or script that changed it.
- Headcount adds a Needed row under the hour-by-hour totals, marks any hour short of it, and names the day’s events.
- Your AI assistant reads the same plan, so “are we covered for the market on Saturday?” gets an answer that already knows about the market.
scheduler demandprints a run of days from the command line, for whoever writes and tests scripts.
Every change carries its reason, such as “Holiday rush: 2 → 3”, so nobody has to wonder why Saturday suddenly needs six cashiers.