activity.matching.score
Classes
Provides scoring based on a number of criteria. |
|
Scores "motivated" bookings higher. A motivated booking is simply a |
|
Scores bookings whose attendees fall into the age-bracket of the |
|
Scores bookings of children higher if their parents are organisers. |
|
Scores bookings of children higher if their parents are admins. |
|
Scores group bookings higher than other bookings. Groups get a boost |
Module Contents
- class activity.matching.score.Scoring(criteria: list[Callable[[Booking], float]] | None = None)[source]
Provides scoring based on a number of criteria.
A criteria is a callable which takes a booking and returns a score. The final score is the sum of all criteria scores.
- class activity.matching.score.PreferMotivated[source]
Scores “motivated” bookings higher. A motivated booking is simply a booking with a higher priority (an attendee would favor a booking he’s excited about.)
- class activity.matching.score.PreferInAgeBracket(get_age_range: Callable[[Booking], tuple[int, int]], get_attendee_age: Callable[[Booking], int])[source]
Scores bookings whose attendees fall into the age-bracket of the occasion higher.
If the attendee falls into the age-bracket, the score is 1.0. Each year difference results in a penalty of 0.1, until 0.0 is reached.
- class activity.matching.score.PreferOrganiserChildren(get_is_organiser_child: Callable[[Booking], bool])[source]
Scores bookings of children higher if their parents are organisers.
This is basically an incentive to become an organiser. A child whose parent is an organiser gets a score of 1.0, if the parent is not an organiser a score 0.0 is returned.
- class activity.matching.score.PreferAdminChildren(get_is_association_child: Callable[[Booking], bool])[source]
Scores bookings of children higher if their parents are admins.
- class activity.matching.score.PreferGroups(get_group_score: Callable[[Booking], float])[source]
Scores group bookings higher than other bookings. Groups get a boost by size:
2 people: 1.0
3 people: 0.8
4 people: 0.6
more people: 0.5
This preference gives an extra boost to unprioritised bookings, to somewhat level out bookings in groups that used no star (otherwise a group might be split up because someone didn’t star the booking).
Additionally a unique boost between 0.010000000 to 0.099999999 is given to each group depending on the group name. This should ensure that competing groups generally do not have the same score. So an occasion will generally prefer the members of one group over members of another group.