if (usableWorkers(pos).coresFree - assigned(pos).sum > 0) { 
that should update:if (usableWorkers(pos).coresFree - assigned(pos).sum >= assignedCore) {