returns num-tilings tile indices corresponding to the floats and ints
(ihtORsize, numtilings, floats, ints=[], readonly=False)
| 88 | |
| 89 | |
| 90 | def tiles(ihtORsize, numtilings, floats, ints=[], readonly=False): |
| 91 | """returns num-tilings tile indices corresponding to the floats and ints""" |
| 92 | qfloats = [floor(f * numtilings) for f in floats] |
| 93 | Tiles = [] |
| 94 | for tiling in range(numtilings): |
| 95 | tilingX2 = tiling * 2 |
| 96 | coords = [tiling] |
| 97 | b = tiling |
| 98 | for q in qfloats: |
| 99 | coords.append((q + b) // numtilings) |
| 100 | b += tilingX2 |
| 101 | coords.extend(ints) |
| 102 | Tiles.append(hashcoords(coords, ihtORsize, readonly)) |
| 103 | return Tiles |
| 104 | |
| 105 | |
| 106 | def tileswrap(ihtORsize, numtilings, floats, wrapwidths, ints=[], readonly=False): |
no test coverage detected