Assume single item belts for estimated throughput calculation
Under Review
Currently, if you have 16 hands for a recipe you'll see estimated performance 60
But if you have 17 hands, you'll see 63.75 which is not possible unless you mix items on belts
I would like to see performance assuming you don't mix items in a single hand
function getCraftingTime(recipe: number[], hands: number): number {
if (hands < recipe.length) return Infinity;
const assigned = new Array(recipe.length).fill(1);
let remaining = hands - recipe.length;
while (remaining > 0) {
const worstTime = Math.max(...recipe.map((qty, i) => qty / assigned[i]));
for (let i = 0; i < recipe.length; i++) {
if (recipe[i] / assigned[i] === worstTime) {
assigned[i]++;
remaining--;
if (remaining === 0) break;
}
}
}
return Math.max(...recipe.map((qty, i) => qty / assigned[i]));
}
Watchers
[ #1 ]
by
[ #2 ]
by
[ #3 ]
by
[ #4 ]
by
[ #5 ]
by
Loading comments...
Loading comments...
5 comments loaded
Sign in to comment on this suggestion.
Sign In