arbor icon indicating copy to clipboard operation
arbor copied to clipboard

Stricter checks on network construction / simulation parameters.

Open thorstenhater opened this issue 1 year ago • 4 comments

We now check that

dt <= min_delay/2

before running a simulation and connections can no longer be constructed with zero delay.

In addition, simulation::run checks that forward progress of at least a single step $\Delta t$ is made. If that is not the case, we assume oversight on part of the user instead of silently doing nothing.

Addresses #2263

thorstenhater avatar Apr 02 '24 13:04 thorstenhater

In this case, dt > min_delay/2 will lead to invalid output because spikes won't be delivered on time. I see that the desire is to "simulate" a zero-delay connection by picking a very small connection delay, so why not just require that they user selects delay = dt/2?

According to Arbor's model, shouldn't dt > min_delay/2 be a hard error, because the following should always be true:

  • dt <= min_delay/2
  • dt > 0
  • min_delay > 0

bcumming avatar Apr 03 '24 04:04 bcumming

Hi @bcumming, currently I am looking at alternatives, but so far I haven't anything I can get behind:

  1. Implicitly changing all delays to at least dt. Altering user input without consent
  2. Allocating a minimum delay like EPSILON. Makes for really slow simulations.
  3. The variant above. Incorrect, as you noted.
  4. Your suggestion of throwing on zero delay. The model needs to know about execution parameters.

Out of those, 4. is probably the least worst option.

thorstenhater avatar Apr 03 '24 08:04 thorstenhater

Do you need the model to know about execution parameters?

Instead, the simulation object could throw during model initialisation, or when simulation::run is called, based on all runtime information. This reflects that while the model might be "correctly" specified, the runtime configuration is not correct.

bcumming avatar Apr 03 '24 08:04 bcumming

My feelings about this:

  • The dt provided to simulation::run should be regarded as firstly a maximum dt and secondly as being up to cell group implementations to interpret in their context of finding a solution (including being ignored).
  • Maximum dt should be greater than zero (we can throw if not a positive number).
  • Because of the above, a cell group should be free to internally set its dt in integration to less than the epoch duration.

halfflat avatar Apr 03 '24 09:04 halfflat