### Description When running a radio station it is generally a good idea to reduce dead air time. The current algorithm for adding tracks to a block/show can leave a lot of dead air time at the end as it doesn't use a very good algorithm. Adding tracks to a show until it is full while making it as full as possible is a well known problem in computer science. It is the [Subset Sum Problem](https://en.wikipedia.org/wiki/Subset_sum_problem). This PR implements a Randomized Greedy with Local Improvement (RGLI) approximation solution for the Subset Sum Problem. The new algorithm is only used when sort type is random and overflow is not enabled and there is no limit on the number of tracks that can be used. **This is a new feature**: Improvement on an existing feature. **I have not updated the documentation to reflect these changes**: I did not update the documentation because the current scheduling algorithm is not currently documented and its existing features have not changed. ### Testing Notes **What I did:** I first attempted a fully polynomial time approximation scheme solution, however it is really bad at finding good solutions for high density values and can kinda slow the more tracks/time you have. So I instead implemented an RGLI which is O(nlogn) and has been giving much better results. I implemented the solution in a separate project and tested it and timed the values with a normal distribution of 500 songs with a mean of 3 minutes and a standard deviation of 1 minute. With a show size of 1 hour the algorithm took around 10-15 ms to run. When adjusting the block size and track size the algorithm still was pretty quick to run. Am going to be testing on an instance with lots of tracks later, will update PR when I have done that. **How you can replicate my testing:** _How can the reviewer validate this PR?_ ### **Links** Closes #3018 |
||
---|---|---|
.github | ||
analyzer | ||
api | ||
api-client | ||
dev | ||
docker | ||
docs | ||
installer | ||
legacy | ||
playout | ||
shared | ||
tools | ||
worker | ||
.codespellignore | ||
.dockerignore | ||
.env.dev | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
.vale.ini | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LEGACY.md | ||
LICENSE | ||
Makefile | ||
README.md | ||
SECURITY.md | ||
Vagrantfile | ||
cloud-init.yml | ||
codecov.yml | ||
docker-bake.json | ||
docker-compose.override.yml | ||
docker-compose.yml | ||
install | ||
pyproject.toml |
README.md
LibreTime makes it easy to run your own online or terrestrial radio station. It is a community managed fork of the AirTime project.
It is managed by a friendly inclusive community of stations from around the globe that use, document and improve LibreTime. Join us in fixing bugs and in defining how we manage the codebase going forward.
Check out the documentation for more information and start broadcasting!
Please note that LibreTime is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
You can find details about our development process in the contributing guide.
Support
To get support for any questions or problems you might have using the software we have a forum at discourse.libretime.org. We are moving towards using the forum to provide community support and reserving the github issue queue for confirmed bugs and well-formed feature requests.
You can also contact us through Matrix (#libretime:matrix.org) where you can talk with other users and developers.
Contributors
Code Contributors
This project exists thanks to all the people who contribute.
Financial Contributors
Become a financial contributor and help us sustain our community on OpenCollective.
Individuals
Organizations
Support this project with your organization. Your logo will show up here with a link to your website.
License
LibreTime is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
Copyright
Copyright (c) 2011-2017 Sourcefabric z.ú.
Copyright (c) 2017-2023 LibreTime Community
Please refer to the LEGACY file for more information.