uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

Query mappsings should be events in a space #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I want all queryable devices to define mappings in a consistent way.  I
also want the mapping process to be a simple lookup, without loops or
conditionals.

This suggests that mappings are actually *classifications* of device data,
not something more complex.

Conceptually, the way to implement this is to require queryables to
represent data as points in a finite, discrete space.  The space would have
one dimension per device element.  The size of each dimension would be the
number of values its element can take on (like 0 or 1 for a key or button),
or a decimated subset of values (like x-position rounded to the nearest .1
degrees, or similar).

Then classification is just using incoming data to index the space, getting
an index, and returning a result for that index.  For a given chunk of
data, time would be ignored and the result for the highest-numbered index
would be returned (some classifications would superceed others).

This would allow for some really nice classifications and complex
dependencies.  For example, an event could be defined for mouse position in
some rectangle AND some button pressed.  All in one lookup uperation.

Practically, this has some hurdles to jump.

We can't just go creating huge arrays to represent huge spaces.  The a
104-key keyboard would have a space of size 2^104, which is absurd.  One
way to avoid this is to ask beforehand which keys (or elements) are going
to be used.  Probably only a handful for most experiments, and therefore a
reasonably-sized space.

Another way is to represent the absurdly huge space conceptually without
implementing it in RAM.  Matlab has a sparse array concept which could help
here.  However, it is limited to two dimensions!

Therefore, we'd have to use custom index <-> subscript functions to index
into a one-dimensional sparse matrix.  This could work.  It could be
managed by the dotsPhenomenon class.  The index <-> subscript functions
should have the following features:
 - subscripts are in an array, not a comma-separated list, so that they can
be accessed by dimension number.
 - subscripts can be a m-by-n array for m points in n-space.
 - indexes can be 1-by-m arrays for m points
 - conversions should require no loops.  I'm not sure how to do this yet,
but it's got to be possible withing the world of linear algebra and
"vectorized" m-code.

Original issue reported on code.google.com by Benjamin.Heasly on 11 Dec 2009 at 6:19

GoogleCodeExporter commented 8 years ago

Original comment by Benjamin.Heasly on 16 Feb 2010 at 10:57

GoogleCodeExporter commented 8 years ago
This has been the true in dotsQueryable for a while...

Original comment by Benjamin.Heasly on 23 Jun 2010 at 11:27