Hacker News new | ask | show | jobs
by Someone 4604 days ago
I expect your simulation simulates the movements of all mice simultaneously in time order.

If so, it might be easier to directly create the overlap results from the simulation. For example, when a mouse enters a box, check and remember what other mice are there. When that mouse leaves, check again and create the record for the stay.

If that isn't possible or feasible, check whether your database supports range types and queries. It might be worthwhile to migrate to PostgreSQL just for this (see https://wiki.postgresql.org/images/7/73/Range-types-pgopen-2...)

1 comments

It is not simultaneous. I use the Gillespie technique for stochastic simulation. I select a mouse at random to change boxes, depending on its transition rate compared to the transition rate of the system as a whole.
Are the mice interchangeable? If so, can you simulate one, get a distribution of box occupancy from it, and compute interactions from that?
No. That's the point. It is a simulation of a complex system. The interactions between the mice are everything.