How an Agent Books a Venue With Four Holds Open at Once
Booking a venue for a team offsite is a waiting game. You ask a few places to hold the dates, and each hold runs out at a different time. Quotes come back over the afternoon and someone adds six people to the list; then the team votes. Somewhere in there a hold expires before anyone noticed, and the best option is gone.
Each hold is a possible future with a clock on it, which is exactly what a Multivergence branch is. This case study goes through examples/holds, where an agent keeps four holds open over two days. The figures come from its recorded output.
Each hold’s probability at each step, from the recorded run.
A Hold Is a Branch With a Deadline
The request goes on the trunk first: 40 people, a budget of 6,000. Then each venue that agrees to hold the dates gets a branch. Its seats become a constraint on the head count, the budget becomes a constraint on its quote, and the hold’s expiry becomes its deadline:
s.Fork("hall-a", mv.Trunk, 0.3)
s.Set("hall-a", "quote/total", []byte("5200"))
s.Constrain("hall-a", mv.AtMost("headcount", 45), mv.AtMost("quote/total", 6000))
s.Expire("hall-a", monday.Add(48*time.Hour))
Hall-a seats 45 and holds for 48 hours. Loft-b seats 60 but only holds for 24. Barn-c seats 80 and villa-d seats 50, and both hold for 72. The agent starts them at weights of 0.3, 0.3, 0.2 and 0.2.
What Happens Over Two Days
Monday at 14:00 the real quotes arrive, and each one is written to its own branch only. Barn-c quotes 7,200, over the budget, so its branch dies when the quote is written.
Tuesday at 08:00 loft-b’s hold has an hour left. The agent asks for more time and the venue agrees to hold until 18:00, so the agent moves the deadline with another Expire. Without that call the hold would have died at 09:00, before the next two pieces of news came in.
At 11:00 six more people sign up. The head count is the same for every venue, so it goes in as a fact, written to every live branch at once. Hall-a seats 45, the head count is now 46, and hall-a dies. At 15:00 the team poll closes, and the agent turns it into likelihoods of 0.7 for loft-b and 0.3 for villa-d. Loft-b ends at 77.8%.
Confirm One, Release the Rest
At 15:30 the manager approves and loft-b confirms. The agent promotes loft-b, so the trunk now holds the venue, its 5,400 quote and the head count of 46.
Villa-d’s hold is still open with the venue, though. A branch is data, and dropping it doesn’t call anyone. So before the promote the agent lists the other live branches, and after it, those are the holds to release with the venues. The history also records villa-d as dropped at the promote, so the list can be rebuilt later. Run it with go run ./examples/holds.