kandi X-RAY | childsplay Summary
kandi X-RAY | childsplay Summary
childsplay
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Play sound
- Plays a sound
- Create the buttons
- Generate a sound sound
childsplay Key Features
childsplay Examples and Code Snippets
Community Discussions
Trending Discussions on childsplay
QUESTION
I'm currently struggling to write an algorithm for my matchmaking system. It's probably childsplay for people who know anything about maths, well, I do not.
Let's take the following example:
A lobby consists of exactly 8 players.
There are 9 parties in the queue. The party sizes are: 1, 6, 3, 8, 2, 1, 5, 3, 2.
The algorithm needs to create as many full lobbies as possible out of those parties.
There may only be full lobbies. So there might be parties that cannot be matched. Those will then wait for new parties to come in the queue.
My current code does match the parties to lobbies, but it lacks the functionality to find the best combinations to find the most possible amount of full lobbies.
Example: Lobby Size of exactly 7, Parties: 2,2,4,3,1,5 -> 2,5 and 4,3 could be matched, but it will do 2,2,3 and 4,1,5 cannot be matched.
I do appreciate any help.
My current code:
...ANSWER
Answered 2020-Oct-08 at 14:43So, after reading through the several links from commenters, it seems like the answer from @Andreas is the most correct one. It seems like my problem is a variant of the bin packing problem, just that in my case I do have the requirement to have only filled bins.
My issue could mostly be solved by using the algorithm I already posted in the question, but sorting all entries from highest to lowest and when filling the lobbies (bins), insert the biggest entries first.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install childsplay
You can use childsplay like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the childsplay component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page