Quants again
As stated earlier, a quant contains some data and meta-information:
- Decay-information
- Fingerprint of the generating node
- Parameters
- Code
The decay information is a value (i.e. an unsigned integer) which
indicates the distance to the originating CPU. When a node receives
a Quant it remembers the neighbour from which it was received and
decides if it absorbs the quant, - i.e. if it will execute the code.
In this case, the results (if any) are computed from the parameters
(if any) and sent back to the originator through the remembered neighbour
where it came from. If the node decides not to absorb the quant, it
decrements the decay value and forwards the modified quant away from
the neighbour (and it's ancestors) and away from the peers of them
(other nodes which have received the quant from the same neighbour).
If there is no further node to send the quant to it hast to be "reflected"
back to the grid. The lower the decay value, the higher has to be
the probability for a quant to be absorbed by a node. If it reaches
a certain threshold (eventually 0) the quant has to be absorbed or
a restart action has to be taken, e.g. a message to the originating
node that the quant has been lost.
Of course there can be developed numerous conditions where quant-waves
can provocate storms, or deplete before they execute, i.e. the quants
get lost. It would be the subject of further studies to provide inside
how to prevent or aliviate or work around this situations.
Without further thinking it seems convenient to count with special
decay information (values) to be able to:
- execute forcibly a quant, independent of the nodes availabilty, or
to
- broadcast a quant without decaying so that it reaches forcibly all
nodes of the grid.
It could also be interesting to specify mecanisms by which quants
can be absorbed by various nodes in order to cache it's code or to
improve the probability to return a result sooner than with the default
distribution/absorbtion mecanism.
The fingerprint is used to identify the originating node. However
the following algorithm would eliminate the need for the enumeration
of the nodes:
- A node that generates a quant, adds a unique fingerprint to it: where
unique is to be thought of in the node's point of view. The fingerprint
is either a random or a secuencial number.
- Each node which forwards a quant stores the identity of the neighbour
it received the quant from as well as the fingerprint, to be able
to route an respective answer back.
- If a quant has a fingerprint already used by another generator, the
receiving node alters the fingerprint with a value of it's own, stores
the new value with the original value and forwards the quant.
- When a return message (or quant) is received, the fingerprint and
route are looked up. If the fingerprint has been mangled by the node,
it is restored before returning it to the respective neighbour.
This algorithm was designed out of the moment and has to be revised
thouroughly.
Georg Lehner May 14, 2004- Magma Soft