Skip to main content

🎲 Weekly Algorithm

Updated today

🎲 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 assigning a space.

If a user cancels their reservation, the space is released and the algorithm runs again to reassign it among the pending pre-bookings.

⏱️ When does it run?

  • On the configured day of the week (isLotteryDay)

  • Reactively, when a user releases a space

βš™οΈ 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?