Sunday, October 30, 2016

Iterators on block sructure, I think

I explains a lot.  I use dot, comma syntax.  NextDot jumps by the block count, NextComma just increments by one.  Interesting but useless if python does not understand the g array index, andI have not worked that.

But, the singleton is a scalar, its block count is one, so it has no differentiation between dot and comma.  Most of theses are at the bottom of the array, the pit.  But singletons can be moved up in groups, like all groups within a quant bin.  There bins are quantized, their bids ate not.  The bots trade the actual value, not the bin.
I updated the block code here. In default, it dumps a new node in the pit, otherwise it is enclosed by the specified node.  I am trying to get iterated functions, like sort, work in the native block mode.

Talk about bins and values a moment
Ifm tyhe site owner publishes a standard huffman encoder for the tree,complete.  The trader bots can detect that.  There are standard parameters like internal and external precision, minimum cycle timer allocations for the site bot,;parameters readable by the bots,they have standard mechanisms for describing tree structure. So, a trading bot, descending the tree may find groups of unclassified bids a the third level down.  It has a natural us of NextDot, NextComma; the iterators resolve, the bot can just scan each value in the bin, from none to many. It will never really sees a finite symbol Huffman encode, except maybe test.  The window size adapts as the queues adapts, most sites will  never have a complete tree tructure.  Thinks of it as a mix of index funds, day traders and pit traders, these are real sequences, and the site bot will have a variable window in the general case,and an incomplete tree, but a tree in which more precision moves the tree closer to fixed point binary Huffman. (The last condiyion is the red/green smooth condition and the Ito condition.  Almost one everywhere means a slight copression of probability space under decomposition, tendency to fixed point.

And, generally. Iterators ate dangerous, especially mine with bugs.  But in general, we want bots to 'free fall', the metaphor of a bot stationary and pick through the tree with iterators is dangerous, unless the iterators enforce descent.  And, iterators are difficult for code verification, unless the counting is locked, guarded, and bounded properly.


class NextDot:
    def __init__(self, low, high):
        self.current = 0
    def __iter__(self):
        return self
    def next(self): # Python 3: def __next__(self)
   self.current += self.count
        if self.count > G.top.count :
            raise StopIteration
        else:
            return self.current

class NextComma:
    def __init__(self, low, high):
        self.current = low
    def __iter__(self):
        return self

    def next(self): # Python 3: def __next__(self)
   self.current += 1
        if self.count > G.top.count :
            raise StopIteration
        else:
            return self.current


No comments: