Skip to main content

🎲 Weekly Algorithm

🎲 Weekly Random Lottery Allocation

Another available feature is the weekly random lottery algorithm, designed to ensure a fair distribution of parking spaces when demand exceeds availability.

🎯 What does this algorithm do?

It allows you to define a day of the week on which a random lottery is automatically executed among the pre-bookings accumulated during the week. This process can include cars, motorcycles, and bicycles.

⚙️ Configuration

This feature is enabled per site. To configure it:

  • Select the corresponding site

  • Go to the site settings

  • Access the Parking module

  • Navigate to the "Allocation Algorithm" section

  • Enable the option "Weekly random lottery algorithm"

  • Choose the day on which the lottery will take place (e.g., Thursday)

  • Select the types of vehicles to include in the random allocation:

    • 🚗 Car

    • 🏍️ Motorcycle

    • 🚲 Bicycle

📌 Reservation statuses

Reservations can be in three states:

  1. Requested / Pre-booking: The reservation has been requested but no space has been assigned yet

  2. Reserved: The space has been successfully assigned

  3. Rejected: No space was assigned in the lottery and there is no availability for the requested date

💡 Note: A pre-booking that remains in "Requested" status is not considered rejected as long as there is still a possibility of allocating a Parking space.

After the weekly lottery, HYBO can run the algorithm again either when a Parking space becomes available or when a new pre-booking is submitted and availability exists for the requested day.

When does the algorithm run?

The weekly allocation algorithm can run in three situations:

  1. Scheduled weekly lottery: The algorithm runs automatically on the configured day of the week, allocating Parking spaces among the pre-bookings for the corresponding period.

  2. When a Parking space becomes available: If a user cancels a booking and releases a Parking space, the algorithm can run again to attempt to allocate it to pending pre-bookings.

  3. New pre-booking after the lottery: If a user creates a pre-booking for a period whose weekly lottery has already taken place, and Parking spaces are available for the requested day, HYBO automatically runs the algorithm to attempt to allocate a space.

Parking space allocation after the weekly lottery

Once the weekly lottery has taken place, users can continue requesting Parking spaces for days within the period that has already been processed.

What happens if Parking spaces are available?

If a user creates a new pre-booking and spaces are available for the requested day, HYBO automatically runs the algorithm to attempt to allocate a space.

This means users no longer need to wait for another colleague to cancel a booking before an allocation can be attempted.

What happens if no Parking spaces are available?

If all Parking spaces are occupied, the pre-booking will remain pending allocation.

If another user subsequently cancels a booking and releases a space, the algorithm can run again to attempt to allocate it among the pending requests.

💡 Practical example

Imagine that the weekly lottery takes place on Thursday to allocate Parking spaces for the following week.

  • On Thursday, the lottery runs and one Parking space remains available for Tuesday.

  • On Friday, a user creates a pre-booking for that Tuesday.

  • Since a space is available, HYBO automatically runs the algorithm to attempt to allocate it.

  • If no spaces were available, the request would remain pending until a space becomes available and another allocation attempt can be made.

This improvement helps make better use of available Parking spaces and speed up allocations after the weekly lottery.

⚙️ How it works

  • Retrieves reservation requests for the entire following week

  • Assigns spaces through simple random allocation, without considering employee or zone priority

  • Groups reservations by shifts (morning, afternoon, full day)

  • Rejects reservations that exceed the number of available spaces

  • Removes transferred reservations from the previous day if applicable

🔔 Notifications

  • To users with an assigned reservation

  • To users rejected due to lack of spaces (only if the variable "NotifyRejectedUsers" is configured via support)

  • To users who released their space, if it is reassigned

📊 Reports

The system can generate and send a report after allocation, depending on the configuration.

Did this answer your question?