jauggy / balance_algorithm

0 stars 0 forks source link

Only use fuzz for Teifion's algorithms #6

Open jauggy opened 1 month ago

jauggy commented 1 month ago
algorithm_modules()[opts[:algorithm]

This is a string

jauggy commented 1 month ago

Inside balancer_server.ex we have this call

                BalanceLib.get_user_rating_rank(userid, rating_type, opts[:fuzz_multiplier])

Maybe the fuzz multiplier get can be a function that takes all the opts.

jauggy commented 1 month ago
Keyword.get(opts, :fuzz_multiplier, @fuzz_multiplier)

First check the balance algo

algo = Keyword.get(opts, :algorithm, "loser_picks")
algos_allowing_fuzz = ~w(loser_picks, force_party)

case Enum.member?(algos_allowing_fuzz, algo) do
 true -> Keyword.get(opts, :fuzz_multiplier, @fuzz_multiplier)
 false -> 0
end