You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming roleConfigs is an array of role configurations that scale with the player quantity that is used to determine the average ratio of roles per game.
roleConfigs.map(({ roles, playerCount })=>{returnroles.map(({ role, count })=>({
role,ratio: count/playerCount}))}).reduce((prev,next)=>{returnnext.map(({ role, ratio },index)=>{return{ role,ratio: (prev[index]?.ratio||0)+ratio}});},[]).map(({ role, ratio },index,array)=>({ role,ratio: ratio/array.length}));
The following assumes that the sum of count found in each role is equal to that of playerCount for that particular configuration - which is then used to determine the ratio of roles for that game, and then again with the output of that result to determine an average.
The text was updated successfully, but these errors were encountered:
Equivalent to the notation of sum(configs.*.roles[index].count) / len(roles) - with index referring to the current loop (also implying that each role is in the exact order that the first config is found in (even if one such role does not exist in a specific configuration).
But as for steering the boat back on course, this is merely for debugging purposes.
The following assumes that the sum of
count
found in eachrole
is equal to that ofplayerCount
for that particular configuration - which is then used to determine the ratio of roles for that game, and then again with the output of that result to determine an average.The text was updated successfully, but these errors were encountered: