Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1017400 // ai_parseTree_makeTotalWeights - also sorts children

JavaX fragment (include)

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());
}

Author comment

Began life as a copy of #1017398

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017400
Snippet name: ai_parseTree_makeTotalWeights - also sorts children
Eternal ID of this version: #1017400/15
Text MD5: c5a42e545eaeb91752f5906fa407c48f
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-13 16:57:51
Source code size: 345 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 401 / 456
Version history: 14 change(s)
Referenced in: [show references]