-
Notifications
You must be signed in to change notification settings - Fork 0
Spotquest
The task of optimising all possible interactions between all jotes, on each timestep, requires graphing them all in an addressable structure which helps distinguish between distant and close pairs. An implementation of this is fairly well begun and is tested in the solar system figment where groups of objects (ie each planetary system) can be so far separated from the others, that very little accuracy is lost by applying gravitation influence between the groups instead of accounting each individual member.
Here the graphs groups (nodes) are called 'spots' as they correspond to measured spots in space which all of their child spots and jotes are guaranteed to fit within.
The proceedure to search out collisions or significant forces between all jotes is called a 'quest'. Without a spotmap to optimise such quests there is as good as one spot containing all jotes. The number of pairings between jotes is set by the 'triangular' relations set of n*(n+1)/2
With a spotmap of recursively nested spots, a quest can be divided into two subproceedures: 'interquest' and 'crossquest' Crossquests purpose is to investigate all pairings of members between two spots ie: members_of_A * members_of_b (rectangular) Interquest purpose is to investigate all pairings within a single spot (the triangular situation). Interquest can do this by (re)interquesting and crossquesting all of its members and pairs...
In figment/spotcollide.js this scheme takes the form:
function questallspots() { interquestspot(rootspot) }
function interquestspot(parent){
if(isLeaf(parent)) { concludeLeaf(parent); return }
forEachKidOfParent(kid of parent) //(pseudosyntax here)
{ interquestspot(kid) }
forEachPairOfKidsInParent(kida,kidb of parent)
{ if(spotsHit(kida,kidb))
{ crossquestspots(kida,kidb) }
}
}
function crossquestspots(para,parb){
if(isLeaf(para)&isLeaf(parb)) { concludeLeaves(para,parb); return }
forEachPairingAcrossParents(kidofa,kidofb of para,parb)
{ if(spotsHit(kidofa,kidofb))
{ crossquestspots(kidofa,kidofb) }
}
}This basic scheme comprehensively covers all necessary spot-to-spot pairings
in the spotmap from the root spot to every leaf spot (spot containing only jotes).
WHere spots_hit() fails deeper connections between those spots are not examined. The process follows and concludes only suitable spot pairings.
The real code labours more, involves testing and the conclusion of leaf spots,
also crossquesting can choose whether to split just one or both of the parent-spots.