svoid ai_parseTree_makeTotalWeights(PTElement e, double weight) { ping(); e.totalWeight = weight*e.weight; for (PTElement child : unnull(e.children)) ai_parseTree_makeTotalWeights(child, e.totalWeight); if (!e instanceof ChoosePart) sortInPlaceByCalculatedFieldDesc(e.children, ai_parseTree_sortingFunction()); }