Difference between revisions of "Nodal reduction"

From Organic Design wiki
(expandable tables for code and diagrams)
m (Comsumption)
Line 26: Line 26:
 
==== Comsumption ====
 
==== Comsumption ====
 
The actual consumption of a quanta of execution occurs by calling the ''nodeReduce'' function which takes no parameters, but maintains its own persistent state defining the current focal node - just like a ''current working directory''. The reduction function applies its quantum by first rotating the current focal node's loop and following its ''nodeLOOP'' association as described above, then checks if there's any non-nodal data, and if there is and it's a function reference it executes it and exits. If a function was executed, then that quantum is considered consumed and the next quantum is executed starting back at [[nodeROOT]] again. But if the data was not executable, then the ''nodeReduce'' function is called again, but remember that current focal node is now down one level because ''nodeLOOP'' was traversed, so the result is that the quanta of execution has been passed within. If there is no ''nodeLOOP'' association, the quantum is passed back up to [[nodeROOT]] unspent, but in practice this condition should not occur.
 
The actual consumption of a quanta of execution occurs by calling the ''nodeReduce'' function which takes no parameters, but maintains its own persistent state defining the current focal node - just like a ''current working directory''. The reduction function applies its quantum by first rotating the current focal node's loop and following its ''nodeLOOP'' association as described above, then checks if there's any non-nodal data, and if there is and it's a function reference it executes it and exits. If a function was executed, then that quantum is considered consumed and the next quantum is executed starting back at [[nodeROOT]] again. But if the data was not executable, then the ''nodeReduce'' function is called again, but remember that current focal node is now down one level because ''nodeLOOP'' was traversed, so the result is that the quanta of execution has been passed within. If there is no ''nodeLOOP'' association, the quantum is passed back up to [[nodeROOT]] unspent, but in practice this condition should not occur.
<table class=expandable title="nodeReduce function from [[nodeSpace.c]]"><tr><td><br>
+
<table class=expandable title="nodeReduce function from nodespace.c"><tr><td><br>
[[+NR.c|]]
+
[[+NR.c|]]<br>
 
</table>
 
</table>
  

Revision as of 02:03, 4 November 2006


The reduction algorithm divides available execution up into quanta which are like "atoms" of change in that they're kind of indivisible. They have no definite rules about the amount of time they can take to execute, but should be generally infinitesimal (linearizable) compared to the macro scale. Any looping or iteration-based functionality should be implemented in terms of reducable structure (process). Top level nodal reduction is implemented as an infinite execute-quantum loop within the context of the root node of the local Nodal Space. The currently running nodal reduction algorithm is defined in nodeSpace.c and sites upon a list space defined in listSpace.c. The afore mentioned infinite execute-quanta loop is in peerd.c.

Associations

Each node has both associative content and a possible local state (which in nodeSpace.c is accessible via a list of pointers using the node-index in the nodes nodeDATA association as an index into an array of pointers). The associations are in the form of nodeRef:nodeRef pairs similar in concept to the key:value pairs of associative arrays, and the non-nodal data is in a form specific to the local runtime environment (if there is no state, it will be returned as the local environments representation of null).

Node names and references

All node referencing at runtime is done using list space indexes not names as in a normal object-model or associative array. For storage and distribution of nodal information, GUIDs are used. List-space references and GUIDs are used internally, but nodes can have context-specific names for external use. The names we use to refer to nodes here in the wiki are taken from the names of the constants to represent them in the peerd.c scripts.

Tree of loops

Using an association called nodeNEXT, allows the formation of loops of nodes (singly-linked-circular lists) within the local Nodal Space (loops also use a nodePREV association too so that nodes can easily be inserted or removed without needing to query other nodes). Combining this with another association called nodeLOOP allows the formation of a loop-tree starting at the root node (nodeROOT node with index zero). Following the nodeLOOP association from nodeROOT takes us down into another node, which is also part of a loop. Every traversal of a nodeLOOP takes us from an item in one loop to an item in another loop. The loop may contain zero items, but the idea here is that nodeLOOP's always connect items in loops, even though other associations may lead to other nodal structure which may or may not be a loop.

Loop rotation

Systems are formed from ongoing, reoccurring patterns which can be described in terms of rotation of the loops in the tree described above. Every time the nodal reduction process follows a nodeLOOP association it also rotates that loop, so that next time the same nodeLOOP association is traversed it will lead to the next node. This process is active (change occurs to the structure) but reversable, ie it's cyclic and non-entropic change.

Comsumption

The actual consumption of a quanta of execution occurs by calling the nodeReduce function which takes no parameters, but maintains its own persistent state defining the current focal node - just like a current working directory. The reduction function applies its quantum by first rotating the current focal node's loop and following its nodeLOOP association as described above, then checks if there's any non-nodal data, and if there is and it's a function reference it executes it and exits. If a function was executed, then that quantum is considered consumed and the next quantum is executed starting back at nodeROOT again. But if the data was not executable, then the nodeReduce function is called again, but remember that current focal node is now down one level because nodeLOOP was traversed, so the result is that the quanta of execution has been passed within. If there is no nodeLOOP association, the quantum is passed back up to nodeROOT unspent, but in practice this condition should not occur.

Division

As the nodal reduction process rotate the loops in the tree, all of the nodes in loops will periodically get execution focus. The period is longer depending on the depth of the loop, since each node is effectively dividing its share of quanta between its currently active child processes. This method of division is called multiplexing, see also Wikipedia's article.

Nodal network

Storage and distribution is a nodal organisation which extends reduction out to form a single harmonic global reduction space called the nodal network. Large organisations involving the process and resources of many individual nodal peers are also formed from and loops, but they rotate on larger cycles which are the globally known harmonics of spectrum.