Wednesday, November 2, 2016

Keeping the bots caged and simple with iteration

We need, make the bots easy to progrm, enforce iteration, and mask he descent.  It is a simpler metaphor.  As in:


while not self.status(DONE) :
for level in depth(2,5)  :
 for singletons in level() :
  if compare(self.price(), singleton.price()) : self.bet(singleton)
  else: scount += 1

imple and balid.  Drop a couple of levels then startlooking for matching ask to my bid.  Compare price, likely a couple of standard comparison function base don the current tree complexity.  Done is set in compare when cycle and timeout costs get risky, better to jump out now, wait a moment and try again.

But, the class nested block pre-constructs the iterators, and using the 'in' word masks the issue of programming a descent.  Programmers just know, search from top to bottom, any restart of a search, restarts another descent the down the graph.

The masking of the descent also masks the cycle cost, but so what.  Time your bots in simulations,  check tree stats, then set descent ranges automatically,.

Here are interation function options.
for s in  singletons()  # stop at each singleton that is nested in node N.
we already have, for l in levels(n,m),mand b in blocks(n,m)

With these iterators, it is not apparent to anyone that the flow is down a nested block, skipping by block counts.  The arithmetic in these iterations is all indices on the array, they are maintained inside the iterator instances during the descent, and thy means no recursive calls, just list stacks.  But, underneath the framework it remains, a descent increases precision, generally, and cycle costs go up as does timeout risk..

No comments: