# Algorithm-based

The **Algorithm-based** slot assignment type automates the process of assigning slots to DJs based on several factors. Once the slots open, DJs can apply for any available slot, but they also have the option to set preferences for specific slots if they’ve applied to more than one. Here’s how it works:

* **DJs Apply:**\
  DJs can apply to one or more available slots using the **RSVP / Manage RSVP** button. If the event creator sets an [**RSVP limit**](/functionalities/commands/server-commands/create-event.md#rsvp-limit), the DJ will be restricted accordingly.
* **Set Slot Preferences:**\
  DJs can set preferences for any of the slots they've applied for using the **Manage Slot Preference** button. A star icon ‘⭐’ will appear next to their preferred slot(s).
* **Slot Assignment Logic:**\
  Once the slots close, the bot uses an algorithm to assign slots considering the following factors:
  * **DJ Preferences:** The bot will prioritize preferred slots unless they’re contested by multiple DJs.
  * **DJ Availability:** If a DJ can only perform at a specific time, the algorithm will factor this in to avoid assigning them to unavailable slots.
  * **Contested Slots Scoring:** If multiple DJs contest the same slot, the bot calculates scores based on:
    * **Total Times Played:** DJs who’ve played the least will be prioritized.
    * **Last Time Played:** DJs who’ve played the longest time ago will have a higher chance.
    * **DJ Roles:** DJs with higher roles [(if set up)](/functionalities/commands/server-commands/setup.md#dj-role-2) receive a small bonus to their score.
    * **Tiebreaker:** If there’s still a tie after scoring, a random pick is used to determine the winner.

Once the algorithm processes the applications and makes its decisions, the final slot assignments are published. All DJs who applied will receive notifications about the outcome.

{% hint style="info" %}
This is a simplified explanation of how the algorithm works. For more details, refer to the [**Slot Assignment Algorithm**](/functionalities/slot-assignment-algorithm.md) section.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vrave.app/functionalities/slot-assignment-types/algorithm-based.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
