-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Algorithm implemention, (rust) #2
Comments
Pile shuffle insparation code for fixing max cards per bin: # Distribute N cards to random bins
t_last_dispense = time.time()
last_bin = -1
cards_in_bin = [0] * len(cfg.bin_heights_load_mm)
for _ in range(cards_per_shuffle_loop):
# Select bin index, ugly brute force but it's fine shutup
while True:
bin_index = random.randint(0, len(cfg.bin_heights_load_mm) - 1)
if cards_in_bin[bin_index] < cfg.max_cards_per_bin and bin_index is not last_bin:
last_bin = bin_index
cards_in_bin[bin_index] += 1
break
cfg.max_cards_per_bin = 10 |
Abishevs
added a commit
that referenced
this issue
Jan 13, 2024
Abishevs
added a commit
that referenced
this issue
Jan 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Abishevs
@LeoAllStar
__Ingen
The text was updated successfully, but these errors were encountered: